- double angle = Vector(endpoint - position).Angle();
- double orthoAngle = angle + (PI / 2.0);
- Vector orthogonal = Vector(cos(orthoAngle), sin(orthoAngle));
- Vector unit = Vector(endpoint - position).Unit();
+ Vector v(position, endpoint);
+ double angle = v.Angle();
+// Vector orthogonal = Vector::Normal(position, endpoint);
+ Vector unit = v.Unit();
+ linePt1 = position, linePt2 = endpoint;
+
+// Horizontally aligned display
+#if 1
+ Vector ortho;
+ double x1, y1, length;
+
+ if (dimensionType == DTLinearVert)
+ {
+ if ((angle < 0) || (angle > PI))
+ // if ((angle < PI_OVER_2) || (angle > PI3_OVER_2))
+ {
+ x1 = (position.x > endpoint.x ? position.x : endpoint.x);
+ y1 = (position.y > endpoint.y ? position.y : endpoint.y);
+ ortho = Vector(1.0, 0);
+ // ortho = Vector(0, 1.0);
+ angle = PI3_OVER_2;
+ // angle = 0;
+ }
+ else
+ {
+ x1 = (position.x > endpoint.x ? endpoint.x : position.x);
+ y1 = (position.y > endpoint.y ? endpoint.y : position.y);
+ ortho = Vector(-1.0, 0);
+ // ortho = Vector(0, -1.0);
+ angle = PI_OVER_2;
+ // angle = PI;
+ }