public void DegreeToArcmin_ValueTest() { var degree = 180; var expectedarcmin = 10800; var arcmin = Astrometry.DegreeToArcmin(degree); Assert.AreEqual(expectedarcmin, arcmin); }
public void CreateByRadiansTest(double inputRadians) { var angle = Angle.ByRadians(inputRadians); var expectedDegree = Astrometry.ToDegree(inputRadians); var expectedArcmin = Astrometry.DegreeToArcmin(expectedDegree); var expectedArcsec = Astrometry.DegreeToArcsec(expectedDegree); var expectedHours = Astrometry.DegreesToHours(expectedDegree); Assert.AreEqual(expectedHours, angle.Hours, TOLERANCE); Assert.AreEqual(inputRadians, angle.Radians, TOLERANCE); Assert.AreEqual(expectedDegree, angle.Degree, TOLERANCE); Assert.AreEqual(expectedArcmin, angle.ArcMinutes, TOLERANCE); Assert.AreEqual(expectedArcsec, angle.ArcSeconds, TOLERANCE); }
private string Deg2str(double deg, int precision) { if (Math.Abs(deg) > 1) { return(deg.ToString("N" + precision) + "° (degree)"); } var amin = Astrometry.DegreeToArcmin(deg); if (Math.Abs(amin) > 1) { return(amin.ToString("N" + precision) + "' (arcmin)"); } var asec = Astrometry.DegreeToArcsec(deg); return(asec.ToString("N" + precision) + "'' (arcsec)"); }
public void OperatorMultiplyDoubleTest(double firstDegree, double secondDegree) { var secondAngle = Angle.ByDegree(secondDegree); var angle = Astrometry.ToRadians(firstDegree) * secondAngle; var expectedRadian = Astrometry.ToRadians(firstDegree) * Astrometry.ToRadians(secondDegree); var expectedDegree = Astrometry.ToDegree(expectedRadian); var expectedArcmin = Astrometry.DegreeToArcmin(expectedDegree); var expectedArcsec = Astrometry.DegreeToArcsec(expectedDegree); var expectedHours = Astrometry.DegreesToHours(expectedDegree); Assert.AreEqual(expectedDegree, angle.Degree, TOLERANCE); Assert.AreEqual(expectedArcmin, angle.ArcMinutes, TOLERANCE); Assert.AreEqual(expectedArcsec, angle.ArcSeconds, TOLERANCE); Assert.AreEqual(expectedHours, angle.Hours, TOLERANCE); Assert.AreEqual(expectedRadian, angle.Radians, TOLERANCE); }
public void StaticAtan2Test(double xRadians, double yRadians) { var xAngle = Angle.ByRadians(xRadians); var yAngle = Angle.ByRadians(yRadians); var angle = Angle.Atan2(yAngle, xAngle); var rad = Math.Atan2(yRadians, xRadians); var expectedDegree = Astrometry.ToDegree(rad); var expectedArcmin = Astrometry.DegreeToArcmin(expectedDegree); var expectedArcsec = Astrometry.DegreeToArcsec(expectedDegree); var expectedHours = Astrometry.DegreesToHours(expectedDegree); Assert.AreEqual(expectedHours, angle.Hours, TOLERANCE); Assert.AreEqual(rad, angle.Radians, TOLERANCE); Assert.AreEqual(expectedDegree, angle.Degree, TOLERANCE); Assert.AreEqual(expectedArcmin, angle.ArcMinutes, TOLERANCE); Assert.AreEqual(expectedArcsec, angle.ArcSeconds, TOLERANCE); }
public double DeterminePolarAlignmentError(double startDeclination, double driftRate, double declinationError) { return(Math.Round(Astrometry.DegreeToArcmin(Astrometry.DetermineDriftAlignError(startDeclination, driftRate, Astrometry.ArcsecToDegree(declinationError))), 2)); }