Returns the oriented smallest angle between two vectors. The computed angle will be in the range (-Pi, Pi]. A positive result corresponds to a counterclockwise (CCW) rotation from v1 to v2; a negative result corresponds to a clockwise (CW) rotation; a zero result corresponds to no rotation.
Computes the interior angle between two segments of a ring. The ring is assumed to be oriented in a clockwise direction. The computed angle will be in the range [0, 2Pi]
Parameters:
p0 - p0 a point of the ring
p1 - p1 the next point of the ring
p2 - p2 the next point of the ring
Returns:
the interior angle based at
p1
publicstatic int getTurn(double ang1, double ang2)
Returns whether an angle must turn clockwise or counterclockwise to overlap another angle.
Parameters:
ang1 - ang1 an angle (in radians)
ang2 - ang2 an angle (in radians)
Returns:
whether a1 must turn CLOCKWISE, COUNTERCLOCKWISE or NONE to overlap a2.
publicstatic double normalize(double angle)
Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ].
Computes the unoriented smallest difference between two angles. The angles are assumed to be normalized to the range [-Pi, Pi]. The result will be in the range [0, Pi].
Parameters:
ang1 - ang1 the angle of one vector (in [-Pi, Pi] )
ang2 - ang2 the angle of the other vector (in range [-Pi, Pi] )
Returns:
the angle (in radians) between the two vectors (in range [0, Pi] )