// quadrant the angle is in... Though, if the y-coordinate of the vector is
// negative, that means that the angle is in quadrants III - IV.
double rawAngle = acos(Unit().x);
+#if 0
double correctedAngle = (y < 0 ? (2.0 * PI) - rawAngle : rawAngle);
+#else
+ double correctedAngle = (y < 0 ? TAU - rawAngle : rawAngle);
+#endif
return correctedAngle;
}
}
+//
+// Convenience function
+//
+/*static*/ double Vector::Angle(Point p1, Point p2)
+{
+ return Vector(p1, p2).Angle();
+}
+
+
// Returns the parameter of a point in space to this vector. If the parameter
// is between 0 and 1, the normal of the vector to the point is on the vector.
// Note: v1 is the tail, v2 is the head of the line (vector).