I wants to convert lat long to indian grid reference (GR) for India Zone 1A and Zone 0.
Example: For India Zone 1A
lat = 77.79669 and
long = 31.53081
I know the gr will be
X=3671296 , Y=08497759
same another example: For India Zone 1A
lat = 78.60744 and
long = 32.06581
and for this gr will be
X=3741976 , Y=0916068
but I don't know the formula and what parameter will used so I can get this GR.
this following code I have used but the answer doesn't matched.
double Lts = Convert.ToDouble(lat);
double Los = Convert.ToDouble(long);
double inverse_flattening = 300.8017255;
double num5 = 6377276.345;
double scale_factor = 1.0;
double central_meridian = 68.0;
double latt_of_origin = 32.50;
double num10 = 2743285.8;//False Easting
double num11 = 914395.5;//False northing
double flattening = 1 / inverse_flattening;
double num8 = 0.40648718;//1st st. parallel
double num9 = 0.50073496;//2nd st. parallel
double num7 = central_meridian * Math.PI / 180.0;
double a2 = latt_of_origin * Math.PI / 180.0;
double num6 = Math.Sqrt((2.0 * flattening) - (flattening * flattening));
double a1 = Lts * Math.PI / 180.0;
double num4 = Los * Math.PI / 180.0;
double a3 = Math.Cos(num8) / Math.Sqrt(1.0 - num6 * num6 * Math.Sin(num8) * Math.Sin(num8));
double a4 = Math.Cos(num9) / Math.Sqrt(1.0 - num6 * num6 * Math.Sin(num9) * Math.Sin(num9));
double num12 = Math.Tan(Math.PI / 4.0 - num8 / 2.0) / Math.Pow((1.0 - num6 * Math.Sin(num8)) / (1.0 + num6 * Math.Sin(num8)), num6 / 2.0);
double a5 = Math.Tan(Math.PI / 4.0 - num9 / 2.0) / Math.Pow((1.0 - num6 * Math.Sin(num9)) / (1.0 + num6 * Math.Sin(num9)), num6 / 2.0);
double x1 = Math.Tan(Math.PI / 4.0 - a1 / 2.0) / Math.Pow((1.0 - num6 * Math.Sin(a1)) / (1.0 + num6 * Math.Sin(a1)), num6 / 2.0);
double x2 = Math.Tan(Math.PI / 4.0 - a2 / 2.0) / Math.Pow((1.0 - num6 * Math.Sin(a2)) / (1.0 + num6 * Math.Sin(a2)), num6 / 2.0);
double y = (Math.Log(a3) - Math.Log(a4)) / (Math.Log(num12) - Math.Log(a5));
double num13 = a3 / (y * Math.Pow(num12, y));
double num14 = num5 * num13 * Math.Pow(x1, y);
double num15 = num5 * num13 * Math.Pow(x2, y);
double num16 = y * (num4 - num7);
Int64 temp_gr_x = Convert.ToInt64(num10 + (num14 * Math.Sin(num16)));
Int64 temp_gr_y = Convert.ToInt64(num11 + num15 - (num14 * Math.Cos(num16)));
temp_gr_x = Convert.ToInt64(temp_gr_x * scale_factor);
temp_gr_y = Convert.ToInt64(temp_gr_y * scale_factor);