public void ConvertRadiansToDegreesFor45DegreesTest() { double actual = BaseAngle.ConvertRadiansToDegrees(BaseAngle.RadiansFor45Degrees); NUnitHelper.AssertDegrees(45.0, actual); }
public void ConvertDegreesToRadiansForZeroTest() { double actual = BaseAngle.ConvertDegreesToRadians(0.0); NUnitHelper.AssertDegrees(BaseAngle.RadiansForZeroDegrees, actual); }
public void ConvertDegreesToRadiansForZeroPlusHalfEpsilonTest() { const double degrees = 0.0 + SelkieConstants.EpsilonDegrees / 2.0; double actual = BaseAngle.ConvertDegreesToRadians(degrees); NUnitHelper.AssertDegrees(0.0, actual); }
public void ConvertDegreesToRadiansForZeroPlusEpsilonTest() { const double expected = 0.0 + SelkieConstants.EpsilonDegrees; double actual = BaseAngle.ConvertDegreesToRadians(expected); NUnitHelper.AssertDegrees(expected, actual); }
protected override bool WorldDraw(Autodesk.AutoCAD.GraphicsInterface.WorldDraw draw) { // SHOW POSITION VALUE Autodesk.AutoCAD.GraphicsInterface.WorldGeometry wg2 = draw.Geometry as Autodesk.AutoCAD.GraphicsInterface.WorldGeometry; if (wg2 != null) { // Push our transforms onto the stack wg2.PushOrientationTransform(Autodesk.AutoCAD.GraphicsInterface.OrientationBehavior.Screen); wg2.PushPositionTransform(Autodesk.AutoCAD.GraphicsInterface.PositionBehavior.Screen, new Point2d(30, 30)); // Draw our screen-fixed text wg2.Text( new Point3d(0, 0, 0), // Position new Vector3d(0, 0, 1), // Normal new Vector3d(1, 0, 0), // Direction BasePoint.ToString() + ":" + NewAngle.ToString() + ":" + BaseAngle.ToString(), // Text true, // Rawness _style // TextStyle ); // Remember to pop our transforms off the stack wg2.PopModelTransform(); wg2.PopModelTransform(); } // END OF SHOW POSITION VALUE if (GetPoint) { Entities.Clear(); Entities.Add(CreateMeasuredJackpanelEntity(BasePoint)); Entities.Add(CreateLine(new Point3d(BasePoint.X + 6, BasePoint.Y + 5, 0), new Point3d(BasePoint.X - 6, BasePoint.Y - 5, 0), 0, 0, 0)); //~~~~~~~~ SCALE ~~~~~~~~~~ Matrix3d trans1 = Matrix3d.Scaling(MyScale, new Point3d(BasePoint.X, BasePoint.Y, 0)); foreach (Entity en in Entities) { en.TransformBy(trans1); } //~~~~~~~~~~~~~~~~~~~~~~~~~ } else if (GetAngle) { Matrix3d trans = Matrix3d.Rotation(NewAngle - BaseAngle, ed.CurrentUserCoordinateSystem.CoordinateSystem3d.Zaxis, new Point3d(BasePoint.X, BasePoint.Y, 0)); foreach (Entity en in Entities) { en.TransformBy(trans); } BaseAngle = NewAngle; //NewAngle = 0; } //~~~~~~~~ SCALE ~~~~~~~~~~ //////if (Atend.Control.Common.SelectedDesignScale != 0) //////{ ////// double ScaleValue = 1 / Atend.Control.Common.SelectedDesignScale; ////// Matrix3d trans1 = Matrix3d.Scaling(1.50, ////// new Point3d(BasePoint.X, BasePoint.Y, 0)); ////// foreach (Entity en in Entities) ////// { ////// en.TransformBy(trans1); ////// } //////} //~~~~~~~~~~~~~~~~~~~~~~~~~ foreach (Entity en in Entities) { draw.Geometry.Draw(en); } return(true); }
private void NewBattery_Click(object sender, RoutedEventArgs e) { Battery b = new Battery("New Battery", "", Weapon.DefinedWeapons[0], new Coordinate("0000", 0), BaseAngle.Create <MilAngle>(0), "pre", 0); b.PropertyChanged += Battery_PropertyChanged; BatteryList.Add(b); SelectedBattery = b; }