mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
fix for angleBetween issue (issue #435), plus todo items
This commit is contained in:
@@ -548,8 +548,11 @@ public class PVector implements Serializable {
|
||||
// http://code.google.com/p/processing/issues/detail?id=340
|
||||
// Otherwise if outside the range, acos() will return NaN
|
||||
// http://www.cppreference.com/wiki/c/math/acos
|
||||
if (amt <= -1 || amt >= 1) {
|
||||
if (amt <= -1) {
|
||||
return PConstants.PI;
|
||||
} else if (amt >= 1) {
|
||||
// http://code.google.com/p/processing/issues/detail?id=435
|
||||
return 0;
|
||||
}
|
||||
return (float) Math.acos(amt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user