Back to project page andQuery.
The source code is released under:
MIT License
If you think the Android project andQuery listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.codingg.andquery.Animation; /*from w w w .j av a2s.com*/ import android.graphics.Point; /** * Created by sanjav on 1/24/15. */ public class CircleAnimation extends TrajectoryAnimation { float radius = 5; float angle = 0; public CircleAnimation(Point startPoint, float radius, float speed, float refinement) { super(startPoint, speed, refinement); this.radius = radius; } @Override public float getX(float currX, float currY) { double x = startPoint.x + (radius * Math.cos(Math.toRadians(angle))); angle += speed; if (angle == 360) angle = 0; return (float) x; } @Override public float getY(float currX, float currY) { double y = startPoint.y + (radius * Math.sin(Math.toRadians(angle))); return (float) y; } @Override public void onTerminate() { } }