Back to project page android-jplay.
The source code is released under:
Copyright (c) Nikolaj Baer All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. ...
If you think the Android project android-jplay 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.nikolajbaer; //w w w. jav a2 s.c o m /* java */ import java.lang.Math; /* jbox2d */ import org.jbox2d.common.Vec2; public class Util { public static Vec2 rotate(Vec2 v,float a){ return new Vec2((float)(v.x * Math.cos(a) - v.y * Math.sin(a)), (float)(v.x * Math.sin(a) + v.y * Math.cos(a))); } /* angle from v1 to v2, provided center at 0,0 */ public static float angleTo(Vec2 v1,Vec2 v2){ double a1=Math.atan(v1.y/v1.x); double a2=Math.atan(v2.y/v2.x); return (float)(a2-a1); } }