public static double AngularSeparation(CartesianCrood Pos1, CartesianCrood Pos2) { double CosD12 = Math.Sin(Pos1.Theta) * Math.Sin(Pos2.Theta) + Math.Cos(Pos1.Theta) * Math.Cos(Pos2.Theta) * Math.Cos(Pos1.Phi - Pos2.Phi); if (CosD12 > 1.0) CosD12 = 1.0; else if (CosD12 < -1.0) CosD12 = -1.0; return Math.Acos(CosD12); }
public static VECTOR AstroCoordToVector(CartesianCrood AnglePair) { return(new VECTOR { X = Math.Cos(AnglePair.Phi) * Math.Cos(AnglePair.Theta), Y = Math.Sin(AnglePair.Phi) * Math.Cos(AnglePair.Theta), Z = Math.Sin(AnglePair.Theta) }); }
public static VECTOR AstroCoordToVector(CartesianCrood AnglePair) { return new VECTOR { X = Math.Cos(AnglePair.Phi) * Math.Cos(AnglePair.Theta), Y = Math.Sin(AnglePair.Phi) * Math.Cos(AnglePair.Theta), Z = Math.Sin(AnglePair.Theta) }; }
public static double AngularSeparation(CartesianCrood Pos1, CartesianCrood Pos2) { double CosD12 = Math.Sin(Pos1.Theta) * Math.Sin(Pos2.Theta) + Math.Cos(Pos1.Theta) * Math.Cos(Pos2.Theta) * Math.Cos(Pos1.Phi - Pos2.Phi); if (CosD12 > 1.0) { CosD12 = 1.0; } else if (CosD12 < -1.0) { CosD12 = -1.0; } return(Math.Acos(CosD12)); }