【BYM】Android 实现相机快门动画,hashmap底层实现原理

本文详细介绍了在Android中如何实现相机快门的动画效果,涉及到数学计算和正弦、余弦函数的应用。同时,文章还提及了HashMap的底层实现原理,帮助读者理解数据结构的基础知识。
摘要由CSDN通过智能技术生成

6.重新计算

依旧是正弦函数,余弦函数,算出点在红线上的位置。

float L1 = (float) Math.sqrt(Math.pow(mRadius, 2.0) -
Math.pow(Math.sin(Math.toRadians(60)) * a, 2.0));

float consL1 = L1 / mRadius;
float sinL1 = (float) Math.sin(Math.toRadians(60)) * a / mRadius;
float L = (float) (L1 + Math.sin(Math.toRadians(30)) * a);

float tagX = L * sinL;
float tagY = L * consL - mRadius;

7.大功告成

99u4k-wt6bw.gif

/**

  • @authoer create by markfrain
  • @github https://github.com/furuiCQ
  • 高怀见物理 和气得天真
  • 时间: 4/28/21
  • 描述: ShootView
    */
    public class ShootView extends View {
    private static final int DEGREE_60 = 60;

private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
private final RectF mBounds = new RectF();
private int mRadius;
private int mCenterX;
private int mCenterY;

private ValueAnimator mPlayAnimator;
private float swipeAgenl = mRadius;//延伸的距离

private float mShootLineTotalRotateAngle;//旋转角度
private ValueAnimator mPreShootLineTotalRotateAnimator;

private float padding = 20;
private ValueAnimator paddingAnimator;

private float fix = 4;
private ValueAnimator fixAnimator;

private static final float SHOOT_LINE_ROTATE_END_RADIANS = (float) (Math.PI / 6.0);//旋转结束弧度
private static final float SHOOT_LINE_ROTATE_START_RADIANS 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值