Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#31 Angle.interiorAngle behavior

open
nobody
None
5
2012-11-16
2012-11-16
wekn eve iknvwnv
No

Coordinate a = new Coordinate(1, 1);
Coordinate b = new Coordinate(1, 0);
Coordinate c = new Coordinate(0, 1);

System.out.println(Angle.toDegrees(Angle.interiorAngle(a, b, c))); // Must be 45° => OK
System.out.println(Angle.toDegrees(Angle.interiorAngle(c, b, a))); // Must be 45° => OK
System.out.println(Angle.toDegrees(Angle.interiorAngle(a, c, b))); // Must be 45° => OK
System.out.println(Angle.toDegrees(Angle.interiorAngle(b, c, a))); // Must be 45° => OK
System.out.println(Angle.toDegrees(Angle.interiorAngle(b, a, c))); // Must be 90° => KO (return 270° !?!?)
System.out.println(Angle.toDegrees(Angle.interiorAngle(c, a, b))); // Must be 90° => KO (return 270° !?!?)

Discussion