You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
612 B
24 lines
612 B
14 years ago
|
package com.jme3.math;
|
||
|
|
||
|
import static org.junit.Assert.assertEquals;
|
||
|
import org.junit.Test;
|
||
|
|
||
|
public class TrigonometryTest {
|
||
|
|
||
|
@Test
|
||
|
public void testVector2(){
|
||
|
Vector2f original = new Vector2f(1, 2);
|
||
|
Vector2f recreated = new Vector2f();
|
||
|
|
||
|
float angle = original.getAngle();
|
||
|
float length = original.length();
|
||
|
|
||
|
recreated.set( FastMath.cos(angle), FastMath.sin(angle) );
|
||
|
recreated.multLocal(length);
|
||
|
|
||
|
assertEquals( original.getX(), recreated.getX(), 0.000001 );
|
||
|
assertEquals( original.getY(), recreated.getY(), 0.000001 );
|
||
|
}
|
||
|
|
||
|
}
|