public AngleHelper(int textDistance, int radius, bool tenth, string symbol) { this.textDistance = textDistance; this.radius = radius; this.tenth = tenth; this.symbol = symbol; SweepAngle = new SweepAngle(); }
/// <summary> /// Takes point in image space and compute various values necessary to measure and draw the angle. /// </summary> public void Update(PointF o, PointF a, PointF b, bool signed, bool ccw, bool supplementary, CalibrationHelper calibration) { if (o == a || o == b) { return; } if (supplementary) { // Supplementary angle to 180°. // Point symmetry around o to find the actual second leg. PointF c = new PointF(2 * o.X - a.X, 2 * o.Y - a.Y); // Both drawing and value are impacted by this directly so we can just swap the new legs in. a = b; b = c; } SweepAngle.Update(o, a, b, (float)radius, signed, ccw); CalibratedAngle = ComputeCalibratedAngle(o, a, b, signed, ccw, calibration); }