Skip to content

Commit

Permalink
add coordinate system conversion assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
aoliaoaoaojiao committed Oct 14, 2022
1 parent a3b2909 commit 5667612
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ public class PocoXYTransformerTest {
public void testOriToUP() {
double pocoX = 100, pocoY = 50;
double[]result = PocoXYTransformer.PocoTransformerVertical(pocoX,pocoY,width,height,270);
Assert.assertEquals(result[0],pocoY,0);
Assert.assertEquals(result[1],height-pocoX,0);
System.out.printf("x:%s,y:%s",result[0],result[1]);
System.out.println();

result = PocoXYTransformer.PocoTransformerVertical(pocoX,pocoY,width,height,90);
Assert.assertEquals(result[0],pocoY,0);
Assert.assertEquals(result[1],pocoX,0);
System.out.printf("x:%s,y:%s",result[0],result[1]);
System.out.println();
}
Expand All @@ -24,10 +28,14 @@ public void testOriToUP() {
public void testUPToOri() {
double upx = 50,upy = 100;
double[]result = PocoXYTransformer.VerticalTransformerPoco(upx,upy,width,height,270);
Assert.assertEquals(result[0],height-upy,0);
Assert.assertEquals(result[1],upx,0);
System.out.printf("x:%s,y:%s",result[0],result[1]);
System.out.println();

result = PocoXYTransformer.VerticalTransformerPoco(upx,upy,width,height,90);
Assert.assertEquals(result[0],upy,0);
Assert.assertEquals(result[1],upx,0);
System.out.printf("x:%s,y:%s",result[0],result[1]);
System.out.println();
}
Expand Down

0 comments on commit 5667612

Please sign in to comment.