//
Point Geometry::RotatePointAroundPoint(Point point, Point rotationPoint, double angle)
{
-// Vector v = Vector(point, rotationPoint);
Vector v = Vector(rotationPoint, point);
double px = (v.x * cos(angle)) - (v.y * sin(angle));
double py = (v.x * sin(angle)) + (v.y * cos(angle));
// Use law of sines to find 2nd & 3rd angles
// sin A / a = sin B / b
// sin B = (sin A / a) * b
+// B = arcsin( sin A * (b / a))
+// ??? ==> B = A * arcsin(b / a)
+/*
+Well, look here:
+sin B = sin A * (b / a)
+sin B / sin A = b / a
+arcsin( sin B / sin A ) = arcsin( b / a )
+
+hmm... dunno...
+*/
+
double angle2 = asin(s2 * (sin(angle1) / s1));
double angle3 = asin(s3 * (sin(angle1) / s1));
*a3 = angle3;
}
+
+Point Geometry::GetPointForParameter(Object * obj, double t)
+{
+ if (obj->type == OTLine)
+ {
+ // Translate line vector to the origin, then add the scaled vector to
+ // initial point of the line.
+ Vector v = obj->p[1] - obj->p[0];
+ return obj->p[0] + (v * t);
+ }
+
+ return Point(0, 0);
+}
+