From 42dc1d36235292786322d28340a81c6cb3fd46c0 Mon Sep 17 00:00:00 2001 From: hurter Date: Wed, 31 Aug 2011 16:25:05 +0000 Subject: --- Data/MathCautra.cs | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Data/MathCautra.cs (limited to 'Data/MathCautra.cs') diff --git a/Data/MathCautra.cs b/Data/MathCautra.cs new file mode 100644 index 0000000..f0cb10a --- /dev/null +++ b/Data/MathCautra.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Drawing; + +namespace Data +{ + public class MathCautra + { + /// CRadarGeo message handlers + static double PI = 3.1415926535; + + /* conversion degres_radian */ + static double degres_radian = PI / 180.0; + + /* translation coordonees Cautra 3 Cautra 4 */ + //static int translationC3 = 4096; + + /* Transformation LAMBERT */ + static double sin_lt = Math.Sin(47.0 * degres_radian); + /* sinus de la latitude de tangeance */ + static double inv_sin_lt = 1.0 / sin_lt; + + /* rayon LAMBERT a l'equateur */ + static double re = 6327.721; + /* rayon LAMBERT au 47 N */ + static double rt = 3201.39922; + + /// + /// Convertion de coordonnees lat,long en 1/8 nm Cautra4 + /// + /// + /// + /// + public static PointF ToCautra4(double latitude, double longitude) + { + double a0; /* Angle de convergence */ + double r0; /* rayon LAMBERT */ + double sin_a0, cos_a0; + double xx; + + a0 = longitude * sin_lt * degres_radian; + xx = Math.Tan(PI / 4 - (latitude * degres_radian) / 2.0); + r0 = re * Math.Pow(xx, sin_lt); + sin_a0 = Math.Sin(a0); + cos_a0 = Math.Cos(a0); + return new PointF( + (float)(8.0 * r0 * sin_a0), + (float)(8.0 * (rt - (r0 * cos_a0)))); + } + } +} -- cgit v1.1