Great Circle equation in terms of Latitude Longitude
Drawing board, three click buttons, calculator , symbol equation ; update 2014-06-06
test function, numerical eqn, replace east deviation by Lat1,Lon1;Lat2,lon2
民國一百零三年六月簽訪中文留言簿,無限制的 全長簽文 2014-06-06
Please use MSIE browser to read this page.
This file is programmed with MSIE 6.0 Update 2009-01-07
Main engine: XYGraph v2.3 - web page graph   ☜☞   donate
This file is personal home work. Output
may contain error. Please verify first.


Drawing board , three drawing buttons ; debug buttons
Two points P1,P2 on a unit sphere define a Great Circle (GC). Each has two values :
Latitude North/South and degrees:minutes:seconds or -90 deg to +90 deg.
Longitude East/West and degrees:minutes:seconds or +180 deg to -180 deg.
Third point P3=(lat3,lon3)=(latV,lonV)=PV for variable point test GC equation.
This program change from [23º45'12" S] to [S 23:45:12].
Link:
S 23:45:12 E 12:34:56 ; N 45:43:21 W 34:56:08 ; N 22:11:00 E 55:44:33
23º45'12" S 12º34'56" E 45º43'21" N 34º56'08" W 22º11'00" N 55º44'33" E
Copy above line, paste to any one of next six boxes, watch change.

N 31:59:5 E 153:26:9 ; N 30:9:6 E 140:10:19 ; N 28:3:14.14 W 162:54:26.112
Copy above line, paste, click [3 on 1,2?] Box12 error is 1.2905695e-10
<inpPoint123> Drawing board , three drawing buttons ; debug buttons
Example , , ,
Point 1, point 2 Lat/Lon NOT control graph. yellow box, green box can control.
Point 1 Point 2 Point 3 GCInp1
Latitude:
Longitude:
P1,P2 great circle equation readEq ;
Box 11, input , , p1p2Ang() ,

P1P2_GC_axis ; ,
Box 12, output       GCInp1

Input Lat/Lon
Link:
Box 13, debug ;

boxqa3.value+='string' ; Following is retired test buttons. // Latitude Longitude
Drawing board , three drawing buttons ; debug buttons
P1,P2 Great Circle axis, 3 different input methods See Box12
Change spherical Latitude Longitude to Cartesian x,y,z. Input Point 1 two Lat/Lon boxes
output to Box12.   ;answer only θφ2xyz
Change spherical Latitude Longitude from radian to deg/min/sec. Input at Box11
output to Box12. If click [21] fill sample data to Box11.
 Add second parameter 1 ,
If input points coincide, code should be able to stop error input.
debug purpose, P1,P2,P3 all six boxes Go look
Above is retired debug buttons. Buttons are active. GCInp1
Below is short explanation for main function. Buttons below are dummy.
function dms2rad() change call function dms2rad()
to get data in string form.
function gc3pt(arg1) verify equation call function dms2rad(1) to
get data in array form. Next call function gc3pt(arg1) to verify equation.
Test new equation in function gc3pt(arg1)
function onchangeManager(arg1) split one string Lat/Lon to six input boxes.

<a name=GCEqn1> GCInp1 Derivation result Equation is NOT proofread by other, maybe error. Link: On unit sphere, give point1=(lat1,lon1) and give angle eastRad at point1 great circle express in terms of lat1,lon1 and eastRad is GCEq1(latV,lonV)= -sin(eastRad) *(-cos(latV)*cos(lonV)*sin(lon1) +cos(latV)*sin(lonV)*cos(lon1) ) +cos(eastRad) *(-sin(lat1) *(cos(latV)*cos(lonV)*cos(lon1) +cos(latV)*sin(lonV)*sin(lon1) ) +sin(latV)*cos(lat1) ) Equation is NOT proofread by other, maybe error. GCEq1 derived in http://freeman2.com/tutc0002.htm where (lat1,lon1) is city1 Latitude Longitude eastRad is at (lat1,lon1) great circle deviate from east angle in radian. (latV,lonV) is a variable point on great circle. (latV,lonV) like (x,y) be unknown. If drop eastRad and use second point (lat2,lon2) <a name=GCEqn2> On unit sphere, given point1=(lat1,lon1) and given point2=(lat2,lon2) the great circle pass (lat1,lon1) and (lat2,lon2) has next expression where (latV,lonV) is variable point. GCEq2(latV,lonV)= -((-sin(lat1)*cos(lat2)*cos(lon2-lon1)+sin(lat2)*cos(lat1)))/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1)))*(cos(lat2)*sin(lon2-lon1)/abs(cos(lat2)*sin(lon2-lon1))) *(-cos(latV)*cos(lonV)*sin(lon1) +cos(latV)*sin(lonV)*cos(lon1) ) +1 *(-sin(lat1) *(cos(latV)*cos(lonV)*cos(lon1) +cos(latV)*sin(lonV)*sin(lon1) ) +sin(latV)*cos(lat1) )/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1))/(cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1))) Equation is NOT proofread by other, maybe error. (latV,lonV) are variable. (lat1,lon1) are given constant. (lat2,lon2) are given constant. All Latitude Longitude angles (latV,lonV) , (lat1,lon1) , (lat2,lon2) must use radian in calculation. <a name=GCEqn3>Drawing board , three drawing buttons ; debug buttons //Below is javascript code. User can change //lat1 to lonV six values. copy/paste below //to http://freeman2.com/complex4.htm#Box3JS //click [test Box3 command output to Box4] lat1=0.437786754041911 //point1 Latitude lon1=2.1211568175904416 //point1 Longitude lat2=0.5593780252641826 //point2 Latitude lon2=2.072578486743266 //point2 Longitude latV=0.5593780252641826 //pointV Latitude lonV=2.072578486743266 //pointV Longitude //Define constants M91,M92,M1,M2,M3,M4,M5 M91=-((-sin(lat1)*cos(lat2)*cos(lon2-lon1)+sin(lat2)*cos(lat1)))/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1)))*(cos(lat2)*sin(lon2-lon1)/abs(cos(lat2)*sin(lon2-lon1))) M92=1/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1))/(cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1))) M1=-M91*sin(lon1) M2=+M91*cos(lon1) M3=-M92*sin(lat1)*cos(lon1) M4=-M92*sin(lat1)*sin(lon1) M5=+M92*cos(lat1) //GCEq3(latV,lonV)= GCEq3= M1*cos(latV)*cos(lonV) GCEq3+=M2*cos(latV)*sin(lonV) GCEq3+=M3*cos(latV)*cos(lonV) GCEq3+=M4*cos(latV)*sin(lonV) GCEq3+=M5*sin(latV) M1 line add M3 line merge to M13=M1+M3 M2 line add M4 line merge to M24=M2+M4 [M13, M24, M5] is great circle axis x, y, z coordinates. //a212181629 GCEq3 //request print great circle value at [latV,lonV] //Above is javascript code. GCEq3 is answer. //Equation is NOT proofread by other, maybe error. 2013-12-01-18-58 verified GCEq3(latV,lonV) be zero. <a name=GCEqn4> easy great circle equation Start hard derivation Above GCEq3=... and GCEq3+=... five lines can be string to one line to get correct answer //GCEq3(latV,lonV)= GCEq3=M1*cos(latV)*cos(lonV)+M2*cos(latV)*sin(lonV)+M3*cos(latV)*cos(lonV)+M4*cos(latV)*sin(lonV)+M5*sin(latV) Write above GCEq3=... and GCEq3+=... five lines in following form, correct for human eye GCEq3= M1*cos(latV)*cos(lonV) +M2*cos(latV)*sin(lonV) +M3*cos(latV)*cos(lonV) +M4*cos(latV)*sin(lonV) +M5*sin(latV) But get error answer in complex4.htm because above five lines only first line enter GCEq3 other four lines not summed. <a name=GCEqn5> Great circle equation derivation will upload to http://freeman2.com/tute0002.htm Part of equation derivation is in Chinese page http://freeman2.com/tutc0002.htm

Drawing board , three drawing buttons ; debug buttons Link:

<a name=GCEqn6> GCInp1 Goto input click build equation then click readEq come back here to read equation. Given lat1= Given lon1= Given lat2= Given lon2= Great circle equation is //3 lines one equation Equation derived from given point P1=[lat1,lon1] and given P2=[lat2,lon2]. Three coefficients are great circle center axis x,y,z (may reverse -1) After click Box11 first two lines tell P3 evaluate to 0 or not. On P1,P2 great circle P3 evaluation value range from -1 to +1. If GCEq(lat3,lon3) [that is GCEq(latV,lonV)] value= +1 or -1, P3 is on P1,P2 great circle north/south pole. If value=0, P3 is on P1,P2 great circle.

<a name=GCDraw> three drawing buttons ; debug buttons
Link:
Great Circle graph generator 2013-12-28
Fill Point1 Lat/Lon (yellow box), Point2 Lat/Lon (green) click [dms2GC()]
[xygraph()] and [Draw Box 23] get curve above.
<GCInp1> ; ;
Fill Lat/Lon to yellow&green box. Click [dms2GC()], [xygraph()], [Draw Box 23]
Example , , , , , ; Box 21 , How to keep graph?
Point11 Lat/Lon (yellow), Point12 Lat/Lon (green) determine great circle above.
Point11 Point12 Point13 dummy
Latitude:
Longitude:
Point11=angle zero. Draw great circle in steps.
Define drawing board size, X axis, Y axis range.
board width   height   unit is point.
Please adjust board size and X,Y range to get X:Y=1:1
X min   X max     Y min   Y max
1st line color= , width= , SoliDot= for rim circle
2nd line color= , width= , SoliDot= for great circle front.
3rd line color= , width= , SoliDot= for great circle back.
4th line color= , width= , SoliDot= not used.
5th line color= , width= , SoliDot= not used.
6th line color= , width= , SoliDot= not used.
SoliDot can be solid or dash or dot ; del
Axes cross at x= , y= ,  
eye coordinate x, y, z 
Screen-up direction x, y, z
<a name=GCInp2> Drawing board , three drawing buttons ; debug buttons
■ Draw South pole to North pole axis? Yes
Color? , thickness? , solid/dash?
■ Draw Point A,B great circle axis? project on equator plane. Yes
Color? , thickness? , solid/dash?
■ Draw ground x,y,z axis?
Color? , thickness? , solid/dash?
X axis length   Y axis length   Z axis length
■ Draw North pole N, city A, city B, earth center O? Yes
N rotate , A rotate , B rotate , O rotate degree.
■ Draw line end points G,H,X,Y ? Yes
G rotate , H rotate , X rotate , Y rotate
Adjust above eight angles in degree, let label N,A,B,O,G,H,X,Y away from curve.
■ Draw equator great circle? Yes
Front color? , thickness? , solid/dash?
Back color? , thickness? , solid/dash?
■ goto Drawing board , three drawing buttons ; debug buttons
Link: ; Latitude Longitude
High precision data 0.1234567890123456 is good to evaluate equation value
But, to draw curve, to store curve data, fewer digit precision is enough.
Set curve data precision to digits.
Box 21 locus x,y,z 3D values can not be drawn. Box 21 data remain highest precision.
"Set curve data precision to" box value control Box 22 locus x,y data, which in turn
change to Box 23 xygraph code values. Shorter data is better, save space.
Box 21 locus x,y,z

function names: dms2GC( ) GCdraw2d( )
Box 22 locus x,y ;

If box 23 has 'MyGraph.Plot(' code ; drawManager( ) GCdim3to2( )
Box 23 xygraph code thinWhite( ) buildGCxyGraph( )

Paste several curve xygraph code to Box 23, click [draw Box 23] to get complicated graph.
Box 24 debug No Link:

boxqb4.value+='string' ; Latitude Longitude
<a name=docA001> 
2013-12-12-18-48 start 
This year 2013, Liu,Hsinhan spend most time 
write Complex variable calculator 
http://freeman2.com/complex4.htm 
Instead of trivial example, LiuHH hope to 
find real example. Go online search for 
stereographic projection and read paper 

<a name=docA002>
2013-11-19-23-44
http://people.maths.ox.ac.uk/earl/G2-lecture5.pdf

2013-11-19-23-47
http://www.math.ubc.ca/~cass/research/pdf/Stereographic.pdf

<a name=docA003>
2013-11-19-23-50
http://people.reed.edu/~jerry/311/stereo.pdf

2013-11-20-00-27
http://www.mech.utah.edu/~brannon/public/rotation.pdf

2013-11-20-00-33
http://www.maths.lth.se/matematiklu/personal/olofsson/CompHT06.pdf

<a name=docA004>
stereographic projection relate to complex 
numbers. LiuHH need draw circle on unit 
sphere. Turn to small circle drawing method. 
Small circle equation  2006-05-11 
http://freeman2.com/jscircl2.htm 
Easier is Great circle equation  2006-04-26 
http://freeman2.com/jscircle.htm 

on 2013-11-30 created gcircle2.htm for 
great circle equation calculation.

<a name=docA005>GCInp1 
Please go to Input P1,P2,P3 
Fill in point 1 Latitude Longitude and 
Fill in point 2 Latitude Longitude values 
(or click example buttons [0] [1] to [6])
point 3 is a test point, see if P3 is on 
P1,P2 great circle. Click buttons are 
 build P1,P2 great circle. click readEq 
goto P1,P2 great circle display location.
 test P3 on P1,P2 great circle.
<a name=docA006> 
 calculate P1,P2 distance in miles. 
 calculate P1,P2 great circle axis.
 change deg/min/sec to radian
 delete blank and tab.
 given P1,P2 calculate PC C=Center
 read number from string. 
 change [34º4'11" N] to [N 34:4:11]
<a name=docA007>
several buttons have similar function or same 
function ([PCPerpen2P1P2()] and [P1P2GCAxis] 
are same) They are debug purpose. 
Main button is 
P1,P2 great circle equation  

Great circle equation is NOT 
proofread by other, maybe error.

<a name=docA008>
Future work move toward draw 3 dimensional 
stereographic projection and find complex 
application.
Liu,Hsinhan 2013-12-12-19-39

<a name=docA009>
2013-12-13-06-35 
update 2013-12-13 modify 
function stringExtractNumber(arg1) 
let '-', '+', 'a212130636' are not a 
number. See source at 'a2121306'
2013-12-13-06-37 

<a name=docA010>GCInp1 
2013-12-18-11-08 start 
update 2013-12-18 modify 
function onchangeManager(arg1) change to 
[[
if(inp0.indexOf('º')>0) 
  {
inp0=todefaultform(inp0);
  } 
]]
this change allow user copy paste 
23º45'12" S 12º34'56" E 45º43'21" N 34º56'08" W 22º11'00" N 55º44'33" E
to gcircle2.htm#inpPoint123 six boxes 
auto convert and distribute to six boxes.

update 2013-12-18 change LonLat2xyz() to 
LatLon2xyz(), modify code let  
    work. 
2013-12-18-11-36 stop 

<a name=docA011> 
Drawing board , three drawing buttons 
2013-12-29-09-39 start 
update 2013-12-29 add drawing function.
Control panel has the following document.
<GCInp1> ; ;
Fill Lat/Lon to yellow&green box. Click [dms2GC()], [xygraph()], [Draw Box 23]
<a name=docA012>
To draw great circle, need three steps. 
 Read 
yellow input box Point11 Latitude, Longitude
N 25:5:0  E 121:32:0 
and read
green input box Point12 Latitude, Longitude 
N 34:3:15  W 118:14:28
pass above four values to function dms2GC() 
Output to Box 21 great circle 3D locus x,y,z
Output to Box 22 great circle 2D locus x,y
<a name=docA013>
Since monitor screen is two dimensional 
surface, program must convert from 3D x,y,z
to 2D x,y. This conversion is done by 
function xyz2xy( //9712241313
line0
)
Change 3D x,y,z to 2D x,y need eye x,y,z 
Same 3D circle x,y,z different eye x,y,z get 
different 2D circle x,y .

<a name=docA014>
 Change 2D circle x,y array to 
XYGraph code. Drawing program need data be 
arranged in XYGraph code. This XYGraph code 
output to Box 23 
Reader can modify Box 23 XYGraph code. For 
example next six lines 
[[
//South pole to North pole
MyLine1.x=[0,0]
MyLine1.y=[-0.9488,0.9488]
MyLine1.VMLstroke="weight=2; color=#88ff88; dashstyle=solid;";
MyGraph.Plot(MyLine1);
MyLine1.x=[];MyLine1.y=[];
]]
is one set curve data. 
<a name=docA015>
"//South pole to North pole" say this line 
is from South pole to North pole 
MyLine1.x=[0,0]
MyLine1.y=[-0.9488,0.9488]
define points (0,-0.9488), (0,0.9488)
Program draw only straight lines. Two points
draw one straight line. For a circle, draw 
many short straight lines.
Code line 
<a name=docA016> 
MyLine1.VMLstroke="weight=2; color=#88ff88; dashstyle=solid;";
assign line thickness be 2 (weight=2) 
line color be #88ff88 (color=#88ff88)
and draw solid line (dashstyle=solid)
dashstyle choices are solid/dash/dot.
If user change weight=2 to weight=3, then 
line from South pole to North pole is thicker.
If user change #88ff88 to #ff0000, then line 
be red.
If user change dashstyle=solid to dashstyle=dot, 
then line be dotted line.

<a name=docA017>
If user want to add equal Longitude great 
circles to example 12 graph, click 
example [16] button, Click [dms2GC()], 
[xygraph()], [Draw Box 23] 
In output Box 23 copy 
//Great circle back
//Great circle front
two set data save to a text file temporally.
<a name=docA018>
Next click example [12] and click [dms2GC()], 
[xygraph()], [Draw Box 23] This time Box 23 
store example [12] data. Now paste example 
[16] Great circle back to top of example [12] 
data and paste example [16] Great circle front 
to bottom of example [12] data. Then click 
[Draw Box 23]. Now output is example [12] 
curve with one equal Longitude great circle.
<a name=docA019>
Repeat this for several more equal Longitude 
great circle at different Longitude value and 
change equal Longitude great circle color to 
lighter value. 
Paste Great circle back to top of XYGraph code 
let other curve over-write back curve. 
Paste Great circle front to bottom of XYGraph 
code let front curve over-write other curve. 
Program draw curve start from top data to 
bottom data.

<a name=docA020>
Code line
MyGraph.Plot(MyLine1);
is draw command. If delete this line, any 
defined curve not draw. 

Code line
MyLine1.x=[];MyLine1.y=[];
erase earlier data, let MyLine1.x and 
MyLine1.y two arrays ready for next data.
If not erase earlier data, if first curve 
has more points, second curve has less 
points, second curve will draw the array 
end earlier data, cause trouble.
2013-12-29-10-57 stop

<a name=docA021> 
2013-12-29-13-11 start
Click button  draw any Box 23 
XYGraph code. It is valid only if XYGraph 
code generated from freeman2.com pages 
http://freeman2.com/xygraph2.htm
http://freeman2.com/xygraph4.htm
http://freeman2.com/xygraphe.htm
http://freeman2.com/sphere3d.htm 
etc.

Click button  delete graph.

<a name=docA022>
Next see examples
Example , , , , , ;
Point11 Lat/Lon (yellow), Point12 Lat/Lon (green) determine great circle above.
Example [11] has 
point A = Taipei Latitude, Longitude. 
point B = Nanking Latitude, Longitude. 
Example [12] has 
point A = Taipei Lat/Lon 25:5:0 121:32:0
point B = Los Angeles Lat/Lon 34:3:15 -118:14:28
<a name=docA023>
This example use '+' for east,north and 
use '-' for west/south. Program made 
correction at time stamp a212271931
Example [13] has 
point A = Taipei Lat/Lon N 25:5:0 E 121:32:0
point B = Los Angeles N 34:3:15 W 118:14:28
This example use E/S/W/N not use '+','-'. 
Example [13] has no problem when Example [12] 
has problem. 
<a name=docA024>
Example [14] has 
point A = Vienna, Austria N 48:15:0 E 16:22:0
point B = Wellington, New Zealand S 41:17:0 E 174:46:0
Example [15] test special case 
point A = Latitude, Longitude N 0:0:0 E 34:56:21
point B = Latitude, Longitude N 0:0:0 W 85:3:39
Both be N 0:0:0 a great circle coincide with 
equator great circle.
<a name=docA025>
Example [16] test special case 
point A = Latitude, Longitude N 0:0:0 E 34:56:21
point B = Latitude, Longitude N 45:0:0 E 34:56:21
Both be E 34:56:21 a great circle of constant 
Longitude value. Program has no trouble. 
If input 
point A = north pole N 90:0:0 E any:value
point B = south pole S 90:0:0 W any:value
gcircle2.htm x,y,z locus calculation get all 
be NaN (Not a Number). not program error, 
this is a math singular condition. 

<a name=docA026> 
Next is Latitude, Longitude input box.
Point11 Point12 Point13 dummy
Latitude:
Longitude:
Above boxes are dummy, not distribute Lat/Lon string.
Yellow box for point 1.
Green box for point 2.
White box for point 3.
<a name=docA027>
To draw a great circle need only two points.
Function test section use point 3 as test point. 
See whether point 3 is on Point 1,2 defined 
great circle.
Draw section keep point 3 White box for future 
small circle page scircle2.htm . To define a 
small circle need three points. Here in 
gcircle2.htm point 3 White box is dummy.
Function test section six Lat/Lon input boxes
and draw section six Lat/Lon input boxes all 
distribute Lat/Lon to right box. 
<a name=docA028>
If copy and paste line 
S 23:45:12 E 12:34:56 ; N 45:43:21 W 34:56:08 ; N 22:11:00 E 55:44:33 
or different type line 
23º45'12" S 12º34'56" E 45º43'21" N 34º56'08" W 22º11'00" N 55º44'33" E
to any one of six boxes, program read six 
Latitude Longitude values and put to proper 
box. If input four 
S 23:45:12 E 12:34:56 ; N 45:43:21 W 34:56:08
Program fill to Point1 and point2 Lat/Lon 
boxes.
If input two 
N 45:43:21 W 34:56:08
Program fill to Point1 OR point2 OR point3 
Lat/Lon boxes. Depend on which box you paste.

<a name=docA029>
Following cases distribution code not work. 
Input three or five Latitude Longitude values, 
distribution code not work. 
Input four without ';'
S 23:45:12 E 12:34:56 N 45:43:21 W 34:56:08
distribution code not work. 
Input four without 'S'
 23:45:12 E 12:34:56 ; N 45:43:21 W 34:56:08
distribution code not work. 

Input four with ';'
23º45'12" S 12º34'56" E ; 45º43'21" N 34º56'08" W
distribution code not work. 
Input four without 'W'
23º45'12" S 12º34'56" E 45º43'21" N 34º56'08" 
distribution code not work. 

<a name=docA030>
Next three lines all activate distribution code
 -23:45:12   12:34:56 ;   45:43:21  -34:56:08
S 23:45:12 E 12:34:56 ; N 45:43:21 W 34:56:08
23º45'12" S 12º34'56" E 45º43'21" N 34º56'08" W

S 23:45:12 E 12:34:56 ; N 45:43:21 W 34:56:08
is gcircle2.htm used format. On the other hand 
23º45'12" S 12º34'56" E 45º43'21" N 34º56'08" W
is online popular use.
<a name=docA031> 
LiuHH write code to convert online popular use
to gcircle2.htm default format. 
Other format not supported. 
Especially 
http://freeman2.com/jscircle.htm
http://freeman2.com/jscircl2.htm
format are NOT supported. 
Chinese language say Longitude Latitude 經緯度
English language say Latitude Longitude.
When write jscircle.htm and jscircl2.htm 
Liu,Hsinahn use Longitude Latitude order, 
this Lon/Lat order is not compatible with 
http://freeman2.com/gcircle2.htm
2013-12-29-14-31 here

<a name=docA032>
Next boxes control drawing board size.
Point11=angle zero. Draw great circle in steps.
Next define drawing board size and X axis, Y axis range.
board width   height   unit is point.
Please adjust board size and X,Y range to get X:Y=1:1
X min   X max     Y min   Y max
<a name=docA033>
"Point11=angle zero. " say Point11 is great circle 
starting point. 
Draw great circle in  steps 
allow user determine step size. If fill  
value less than 20, program ignore it and 
use default 90 steps. Fill in 20 or bigger 
program will accept it. 

<a name=docA034>
board width   height 
control drawing board size. If change to 
500/500 although it is square, but title 
squeeze board drawing area not a square, 
output a slight flat earth.
If use width/height 360/360 with title in 
place. No such distortion.
If use width/height 500/560 no distortion.

<a name=docA035>
X min  X max   Y min  Y max 
determine drawing board x axis y axis range.
Draw great circle in unit sphere, 
need just x:-1/+1 and y:-1/+1 
Now use x:-1.25/+1.25 and y:-1.25/+1.25 
It should be ok for whole great circle 
picture. 

<a name=docA036> 
If reader copy other XYGraph 
from for example xygraphe.htm Example 
Box 1 input XYGraph code (copy these 
XYGraph code) and paste to gcircle2.htm 
Box 23 xygraph code and click 
In this case x:-1/+1 and y:-1/+1 is not 
compatible xygraphe.htm Example  data 
Because xygraphe.htm Example [1] command 
[[
MyGraph.xmin=QSboxXmin0.value=-3;
MyGraph.xmax=QSboxXmax0.value=+3;
MyGraph.ymin=QSboxYmin0.value=-3;
MyGraph.ymax=QSboxYmax0.value=+3;
]]
HTML element QSboxXmin0 etc are not defined 
in gcircle2.htm 

<a name=docA037>
If reader copy other XYGraph from for 
example in sphere3d.htm click 
then copy sphere3d.htm Box 1 XYGraph code
and paste XYGraph code to gcircle2.htm 
Box 23 xygraph code and click 
In this case x:-1/+1 and y:-1/+1 is not 
compatible with sphere3d.htm XYGraph code. 
Because sphere3d.htm XYGraph code 
need x:-3/+3 and y:-3/+3 
 not x:-1/+1 and y:-1/+1 
After you change from
X min  X max   Y min  Y max 
to
X min  X max   Y min  Y max 
click  get proper graph.
2013-12-29-15-11 stop

<a name=docA038>
2013-12-29-16-26 start 
Next is line specification, color, width 
and solid/dash/dot.
GCInp1
x,y value below should be within range above.
1st line color= , width= , SoliDot= for rim circle
2nd line color= , width= , SoliDot= for great circle front.
3rd line color= , width= , SoliDot= for great circle back.
4th line color= , width= , SoliDot= not used.
5th line color= , width= , SoliDot= not used.
6th line color= , width= , SoliDot= not used.
SoliDot can be solid or dash or dot ; del
<a name=docA039>
1st line is for rim circle. For unit sphere, 
rim circle has radius=1. Always visible.
2nd line is for great circle front, visible 
part. 
3rd line is for great circle back, invisible 
part. 
Draw great circle and distinguish front part 
from back part, let user see it clearly.
4th line to 6th line are not used.
<a name=docA040>
GCInp1 ; Next is
Axes cross at x= , y= ,   Del x,y axis
This choice allow user delete 
x,y axis. gcircle2.htm draw 3D picture, 
if program draw 2D x,y axis, that is not 
compatible. If user see a flat rim circle,
check  let graph show x,y axis, see if 
x range xmax-xmin = y range ymax-ymin. 

<a name=docA041> 
If a picture range x:[5,7] and y:[6,8] 
if set x,y range   x:[5,7] and y:[6,8] 
Axes cross at x=  , y= 
then program must draw [0,0] and actual 
range is  x:[0,7] and y:[0,8] Picture 
is at upper right corner with big blank 
space.
user can set Axes cross to the following 
Axes cross at x=  , y= 
then x,y range x:[5,7] and y:[6,8] is 
valid.

<a name=docA042>
GCInp1 Next is eye and screen up.
eye coordinate x, y, z 
Screen-up direction x, y, z
<a name=docA043>
If given two cities not change, but change 
eye location or change screen-up direction 
output graph different.
eye location [xe,ye,ze] and 
screen-up direction [xu,yu,zu] 
two vectors can not be parallel. 
Screen is a 2D flat square. If put eye on 
screen up direction look at screen, 
screen is just a line. No graph at all.

<a name=docA044>
Next are drawable/droppable curves. 
they are (GCInp2)
■ Draw South pole to North pole axis
  //ON line
■ Draw Point A,B great circle axis? 
  //OG line
  project on equator plane
  //OH line
  //O and H are inside sphere.
<a name=docA045>
■ Draw ground x,y,z axis?
  //OX line is ground x axis, 
  //OY line is ground y axis.
■ Draw North pole N, city A, city B, 
  earth center O?
■ Draw line end points G,H,X,Y ?
■ Draw equator great circle?

<a name=docA046> 
All above default draw (not omit). 
Draw North pole N, city A, city B and 
earth center O. Line end points G,H,X,Y
eight points each has a rotation box. 
If rigid assign all label (N,A,B etc.) 
be on top of square/triangle/circle dots.
In some case label and curve coincide 
which is not desirable. Example 11 to 16 
each click button define eight label to 
dot relative angles. 
<a name=docA047>
If user draw curve, modify eight relative 
angles for better output. Relative angle 
is in degree. 
Positive clockwise, negative counter. 
Zero relative angle is label on top of 
dot.
2013-12-29-17-15 stop  //a212291715

<a name=docA048>
2013-12-29-18-18 start 
In the year 2013, Liu,Hsinhan spend nine 
month write complex number calculator 
http://freeman2.com/complex4.htm
In 2013-Dec write great circle drawing 
generating program 
http://freeman2.com/gcircle2.htm

Compare complex4.htm with gcircle2.htm 
Although single complex function output 
look ok, but complex4.htm has parenthesis 
pair insertion code which cause problem. 

LiuHH still expect debug complex4.htm and 
can not say "complex4.htm is done."

<a name=docA049>
gcircle2.htm is simple and easy to tell 
right or wrong by visual check. 
gcircle2.htm is possibly OK. 
Next year 2014 Liu,Hsinhan hope to write 
small circle drawing program scircle2.htm 
and write stereographic projection program.

<a name=docA050>
All of LiuHH program are just a trial file. 
Reader please expect errors in file. Please 
expect mathematics expert, programming expert 
modify/improve LiuHH program. 
2013-12-29-18-32 stop 

<a name=docA051> 
Derivation conclusion Hard derivation
2013-12-30-08-32 start 
To find great circle equation that is 
both easy and difficult. 
If given great circle axis vector, it is 
a easy job to find great circle equation.
If given two cities Latitude Longitude 
values, it is a difficult job to find 
great circle equation. 
This page gcircle2.htm accept given two 
points Lat/Lon values. Equation derivation 
is difficult. 
<a name=docA052>
Whole derivation begin 70% is in Chinese 
page 
http://freeman2.com/tutc0002.htm
Derivation later 30% is in current page 
http://freeman2.com/gcircle2.htm
draft work section, from draft001 
to draft047
In the future, LiuHH 
will write complete equation derivation 
in English page 
http://freeman2.com/tute0002.htm

<a name=docA053>
Given great circle axis vector, easy job 
to find great circle equation is right 
below. 
Assume given great circle axis vector is 
V0=[x0,y0,z0]   //all known 
Assume arbitrary vector on unit sphere is 
Vp=[xp,yp,zp]   //all unknown 
Those arbitrary point on great circle 
must be perpendicular to [x0,y0,z0]. 
<a name=docA054>
Write vector dot product equation get 
[x0,y0,z0] dot [xp,yp,zp] = 0 ---GCZ.eq0
that is 
 x0*xp
+y0*yp
+z0*zp
=0  ---GCZ.eq1

<a name=docA055>
GCZ.eq1=Great Circle eaZy EQuation 1
Both [x0,y0,z0] and [xp,yp,zp] are on 
unit sphere. Vector must have length 
be one constraint.
sqrt(x0*x0+y0*y0+z0*z0)=1 ---GCZ.eq2
and
sqrt(xp*xp+yp*yp+zp*zp)=1 ---GCZ.eq3

<a name=docA056> 
A unit vector in spherical coordinate 
expression is simpler. 
Assume [x0,y0,z0] has lat0, lon0 
and 
assume [xp,yp,zp] has latp, lonp 
then 
[x0,y0,z0] =  ---GCZ.eq4
[ cos(lat0)*cos(lon0),  //this is x0
  cos(lat0)*sin(lon0),  //this is y0
  sin(lat0) ]           //this is z0
//require vector [x0,y0,z0] length be one 
<a name=docA057>
and 
[xp,yp,zp] =  ---GCZ.eq5
[ cos(latP)*cos(lonP),  //this is xp
  cos(latP)*sin(lonP),  //this is yp
  sin(latP) ]           //this is zp
//require vector [xp,yp,zp] length be one 

<a name=docA058>
GCZ.eq4 and GCZ.eq5 lat,lon expression 
satisfy GCZ.eq2 andGCZ.eq3 automatically.
For example substitute GCZ.eq5 into 
sqrt(xp*xp+yp*yp+zp*zp)=1 ---GCZ.eq3
get 
sqrt[cos(latP)*cos(lonP)*cos(latP)*cos(lonP)
    +cos(latP)*sin(lonP)*cos(latP)*sin(lonP)
    +sin(latP)*sin(latP)]
=
<a name=docA059>
sqrt[cos(latP)*cos(latP)*cos(lonP)*cos(lonP)
    +cos(latP)*cos(latP)*sin(lonP)*sin(lonP)
    +sin(latP)*sin(latP)]
=
<a name=docA060>
sqrt[cos(latP)*cos(latP)*
    {cos(lonP)*cos(lonP)+sin(lonP)*sin(lonP)}
    +sin(latP)*sin(latP)]
=
sqrt[cos(latP)*cos(latP)*1
    +sin(latP)*sin(latP)]
=sqrt[1]
=1   ---GCZ.eq6
Similarly, GCZ.eq4 automatic satisfy length 
be one constraint.

<a name=docA061> 
Now substitute GCZ.eq4 and GCZ.eq5 into 
 x0*xp
+y0*yp
+z0*zp
=0  ---GCZ.eq1
get 

<a name=docA062> Begin derivation Hard derivation Great circle equation cos(lat0)*cos(lon0)*cos(latP)*cos(lonP) +cos(lat0)*sin(lon0)*cos(latP)*sin(lonP) +sin(lat0)*sin(latP) =0 ---GCZ.eq7 GCZ.eq7 is easy great circle equation. //hard equation see GCEqn4 Red lat0, lon0 are given axis location. Blue latP, lonP are arbitrary point.

<a name=docA063> However, given city A lat1, lon1 and given city B lat2, lon2 It is a complicated equation to express axis lat0, lon0 in terms of lat1, lon1 and lat2, lon2. <a name=docA064> In GCZ.eq7 if require right side equal to sin(latS) and require given axis be earth center to north pole [0,0,1] the result is small circle equation. If ask latitude=30 degree Set latS=30degree=0.5235987755982988 rad then GCZ.eq7 plus right side = sin(30deg) get equal latitude small circle equation. <a name=docA065> Do calculation in Cartesian coordinate system is easy. Do calculation in spherical coordinate system is hard. 2013-12-30-09-39 stop <a name=docA066> 2013-12-30-19-15 start How to keep graph? If user draw a great circle graph and hope save graph to a picture file grCircle.jpg . How to keep graph? LiuHH know one method. Draw great circle graph, let monitor screen display complete graph. Press [control] key and press [PrtSc] (print screen). Screen image saved to clip board. Next open a drawing program, for example MSPaint (V6.1) or Paint Shop Pro (V7.0) Paste screen image to MSPaint window. Select the area you like save to a file. 2013-12-30-19-25 stop <a name=docA067> 2014-01-02-09-51 論語里仁四之十九 子曰:「父母在,不遠遊,遊必有方。」 Confucius remarked: "While his parents are living, a son should not go far abroad. If he does, he should let parents know where he goes." <a name=docA068> 論語八佾三之七 子曰:「君子無所爭,必也射乎,揖讓而升,下而飲, 其爭也君子。」 Confucius remarked: "A gentleman never competes in anything he does, except perhaps in archery. But even then, when he wins he courteously makes his bow before he advanced to take his place among the winners; and, when he has lost he walks down and drinks his cup of forfeit. Thus, even in this case of competition, he shows to be a gentleman." //forfeit=喪失 <a name=docA069> 論語衛靈公第十五之十一 子曰:「人無遠慮,必有近憂。」 Confucius remarked: "If a man takes no thought for the morrow, he will be sorry before today is out." <a name=docA070> 論語衛靈公第十五之二十三 子貢問曰:「有一言而可以終身行之者乎?」 子曰:「其恕乎!己所不欲,勿施於人。」 Student TzuGong ask: "Is there one word which may guide one in practice throughout his whole life?" Confucius answered: "The word 'charity' is perhaps the word. What you do not wish others do to you, do not do unto them." 2014-01-02-10-36 LiuHH remark Confucius 551BC to 479BC. [charity]=[恕]=[如心]=simulate(如) other's mind(心) <a name=docA071> 2014-01-02-11-10 start update 2014-01-02 change graph title date/time string from "2014-1-1-8-6" to "2014-01-01-08-06" Code correction has time stamp a301012142 Default graph title is Great circle generator freeman2.com/gcircle2.htm 2014-01-01-08-06 User can change graph title after copy and paste graph to MSPaint. Use MSPaint editor change title. LiuHH save work, do not add title input box. 2014-01-02-11-17 stop <a name=docA072> 2014-01-03-02-37 start On 2014-01-03 Liu,Hsinhan start sign world guestbook. Contents is next, but it may change a little bit during sign. [[ Welcome download the following programs Great Circle graph generator 2013-12-31 http://freeman2.com/gcircle2.htm Complex number calculator 2013-03-28 http://freeman2.com/complex4.htm Math Logic Truth Table 2012-12-08 http://freeman2.com/logictt2.htm Build code to draw spherical coordinate http://freeman2.com/sphere3d.htm Spherical triangle graph 2011-07-10 http://freeman2.com/sphtrian.htm <a name=docA073> Use Rodrigues Construction to prove Euler's Rotation Theorem 2011-07-03 http://freeman2.com/tute0055.htm Proof of Newton's inequality http://freeman2.com/tute0043.htm Spelling check http://freeman2.com/dict000a.htm no dictionary, 102kBytes http://freeman2.com/dict67en.zip English, 1.88MBytes http://freeman2.com/dict34fr.zip French, 880kBytes http://freeman2.com/dict25es.zip Spanish, 654kBytes http://freeman2.com/dict53de.zip German, 1.78MBytes Javascript index has more programs http://freeman2.com/jsindex2.htm <a name=docA074> Confucius remarked: "While his parents are living, a son should not go far abroad. If he does, he should let parents know where he goes." Student TzuGong ask: "Is there one word which may guide one in practice throughout his whole life?" Confucius answered: "The word 'charity' is perhaps the word. What you do not wish others do to you, do not do unto them." 2014-01-02-10-36 Liu,Hsinhan remark Confucius 551BC to 479BC. 2014-01-02-17-16 Liu,Hsinhan 劉鑫漢 ]] 2014-01-03-02-41 stop <a name=doc_end> [==] following is draft <a name=draft001> 2013-12-01-12-05 given (lat1,lon1) (lat2,lon2) (lat3,lon3) three points on unit sphere. find (lon0,lat0) on unit sphere which is equal distance from three given points. //2013-12-30-11-31 note: above is small //circle requirement, which is recorded //during great circle derivation. Above //not apply to following. //following main work is express eastRad //in terms of lat1,lon1 and lat2,lon2 . <a name="draft002"> great circle through (lat1,lon1) eastRad is eqA(latV,lonV)= -sin(eastRad) *(-cos(latV)*cos(lonV)*sin(lon1) +cos(latV)*sin(lonV)*cos(lon1) ) +cos(eastRad) *(-sin(lat1) *(cos(latV)*cos(lonV)*cos(lon1) +cos(latV)*sin(lonV)*sin(lon1) ) +sin(latV)*cos(lat1) ) <a name="draft003"> where (lat1,lon1) is city1 Latitude Longitude eastRad is at (lat1,lon1) great circle deviate from east angle in radian. (latV,lonV) is a variable point on great circle. (latV,lonV) like (x,y) be unknown. set eqA(latV,lonV) to eqA(lat1,lon1) get <a name="draft004"> eqA(lat1,lon1)= -sin(eastRad) *(-cos(lat1)*cos(lon1)*sin(lon1) +cos(lat1)*sin(lon1)*cos(lon1) ) +cos(eastRad) *(-sin(lat1) *(cos(lat1)*cos(lon1)*cos(lon1) +cos(lat1)*sin(lon1)*sin(lon1) ) +sin(lat1)*cos(lat1) ) <a name="draft005"> = -sin(eastRad) *(-cos(lat1)*cos(lon1)*sin(lon1) +cos(lat1)*cos(lon1)*sin(lon1) ) +cos(eastRad) *(-sin(lat1) *(cos(lat1)*[cos(lon1)*cos(lon1) +sin(lon1)*sin(lon1) ] ) +sin(lat1)*cos(lat1) ) <a name="draft006"> = -sin(eastRad) *(0) +cos(eastRad) *(-sin(lat1) *(cos(lat1)*[1]) +sin(lat1)*cos(lat1) ) <a name="draft007"> = -sin(eastRad) *(0) +cos(eastRad) *(-sin(lat1)*cos(lat1) +sin(lat1)*cos(lat1) ) = -sin(eastRad) *(0) +cos(eastRad) *(0) = 0 (lat1,lon1) satisfy eqA(latV,lonV) 2013-12-01-13-28 <a name="draft008"> Next set eqA(latV,lonV) to eqA(lat2,lon2) and set result expression to zero for point2 (lat2,lon2) is on same great circle. get eqA(lat2,lon2)= -sin(eastRad) *(-cos(lat2)*cos(lon2)*sin(lon1) +cos(lat2)*sin(lon2)*cos(lon1) ) +cos(eastRad) *(-sin(lat1) *(cos(lat2)*cos(lon2)*cos(lon1) +cos(lat2)*sin(lon2)*sin(lon1) ) +sin(lat2)*cos(lat1) ) =0 <a name="draft009"> -sin(eastRad) *(-cos(lat2)*cos(lon2)*sin(lon1) +cos(lat2)*cos(lon1)*sin(lon2) ) +cos(eastRad) *(-sin(lat1) *(cos(lat2)*cos(lon2)*cos(lon1) +cos(lat2)*sin(lon2)*sin(lon1) ) +sin(lat2)*cos(lat1) ) =0 one equation one unknown eastRad. How to solve for eastRad ? <a name="draft010"> +sin(eastRad) *(-cos(lat2)*cos(lon2)*sin(lon1) +cos(lat2)*cos(lon1)*sin(lon2) ) = +cos(eastRad) *(-sin(lat1) *(cos(lat2)*cos(lon2)*cos(lon1) +cos(lat2)*sin(lon2)*sin(lon1) ) +sin(lat2)*cos(lat1) ) <a name="draft011"> tan(eastRad)=sin(eastRad)/cos(eastRad) =[-sin(lat1) *(cos(lat2)*cos(lon2)*cos(lon1) +cos(lat2)*sin(lon2)*sin(lon1) ) +sin(lat2)*cos(lat1) ] / [-cos(lat2)*cos(lon2)*sin(lon1) +cos(lat2)*cos(lon1)*sin(lon2) ] <a name="draft012"> eastRad= arctan{ [-sin(lat1) *(cos(lat2)*cos(lon2)*cos(lon1) +cos(lat2)*sin(lon2)*sin(lon1) ) +sin(lat2)*cos(lat1) ] / [-cos(lat2)*cos(lon2)*sin(lon1) +cos(lat2)*cos(lon1)*sin(lon2) ] } //2013-12-01-13-36 <a name="draft013"> eastRad= arctan{ [-sin(lat1)*cos(lat2) *( cos(lon2)*cos(lon1) +sin(lon2)*sin(lon1) ) +sin(lat2)*cos(lat1) ] / [cos(lat2)* ( cos(lon1)*sin(lon2)-cos(lon2)*sin(lon1)) ] } <a name="draft014"> eastRad= arctan{ [-sin(lat1)*cos(lat2)*cos(lon2-lon1) +sin(lat2)*cos(lat1) ] / [cos(lat2)*sin(lon2-lon1)] } 2013-12-01-13-46 <a name="draft015"> if z=arctan(x) sin(z)=x/sqrt(1+x*x) cos(z)=1/sqrt(1+x*x) now x=[-sin(lat1)*cos(lat2)*cos(lon2-lon1) +sin(lat2)*cos(lat1) ] /[cos(lat2)*sin(lon2-lon1)] <a name="draft016"> x*x=[-sin(lat1)*cos(lat2)*cos(lon2-lon1) +sin(lat2)*cos(lat1) ] *[-sin(lat1)*cos(lat2)*cos(lon2-lon1) +sin(lat2)*cos(lat1) ] /[cos(lat2)*sin(lon2-lon1)] /[cos(lat2)*sin(lon2-lon1)] <a name="draft017"> x*x=[+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1) +sin(lat2)*cos(lat1)*sin(lat2)*cos(lat1) -2*sin(lat1)*cos(lat2)*cos(lon2-lon1)*sin(lat2)*cos(lat1) ] /[cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1)] <a name="draft018"> 1+x*x= [+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1) +sin(lat2)*cos(lat1)*sin(lat2)*cos(lat1) -2*sin(lat1)*cos(lat2)*cos(lon2-lon1)*sin(lat2)*cos(lat1) +cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1) ] /[cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1)] <a name="draft019"> 1+x*x= [+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1) +sin(lat2)*sin(lat2)*cos(lat1)*cos(lat1) -2*sin(lat1)*cos(lat2)*cos(lon2-lon1)*sin(lat2)*cos(lat1) +cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1) ] /[cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1)] <a name="draft020"> 1+x*x= [+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1) +cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1) +cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2) -2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1) ] /[cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1)] <a name="draft021"> if z=arctan(x) sin(z)=x/sqrt(1+x*x) cos(z)=1/sqrt(1+x*x) now x=[-sin(lat1)*cos(lat2)*cos(lon2-lon1) +sin(lat2)*cos(lat1) ] /[cos(lat2)*sin(lon2-lon1)] <a name="draft022"> sin(z)={[-sin(lat1)*cos(lat2)*cos(lon2-lon1) +sin(lat2)*cos(lat1) ] /[cos(lat2)*sin(lon2-lon1)]} / sqrt{ [+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1) +cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1) +cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2) -2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1) ] /[cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1)] } <a name="draft023"> above blue [cos(lat2)*sin(lon2-lon1)] cancel red sqrt[cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1)] to one if blue is positive. to negative one if blue is negative. next if() distinguish the +/- condition. <a name="draft024"> if( cos(lat2)*sin(lon2-lon1) >=0) sin(z)={[-sin(lat1)*cos(lat2)*cos(lon2-lon1) +sin(lat2)*cos(lat1) ] } / sqrt{ [+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1) +cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1) +cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2) -2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1) ] } <a name="draft025"> else sin(z)=-{[-sin(lat1)*cos(lat2)*cos(lon2-lon1) +sin(lat2)*cos(lat1) ] } / sqrt{ [+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1) +cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1) +cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2) -2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1) ] } <a name="draft026"> Next one equation take care blue is positive or negative both cases. sin(z)={[-sin(lat1)*cos(lat2)*cos(lon2-lon1) +sin(lat2)*cos(lat1) ] } / sqrt{ [+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1) +cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1) +cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2) -2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1) ] } *[cos(lat2)*sin(lon2-lon1)/abs(cos(lat2)*sin(lon2-lon1))] last line is +1 or -1 depend on sign of [cos(lat2)*sin(lon2-lon1)] 2013-12-01-15-30 sin(z)=((-sin(lat1)*cos(lat2)*cos(lon2-lon1)+sin(lat2)*cos(lat1)))/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1)))*(cos(lat2)*sin(lon2-lon1)/abs(cos(lat2)*sin(lon2-lon1))) <a name="draft027"> if z=arctan(x) sin(z)=x/sqrt(1+x*x) cos(z)=1/sqrt(1+x*x) now x=[-sin(lat1)*cos(lat2)*cos(lon2-lon1) +sin(lat2)*cos(lat1) ] /[cos(lat2)*sin(lon2-lon1)] <a name="draft028"> //2013-12-01-14-50 lon1=2.1211568175904416 lat1=0.437786754041911 lon2=2.072578486743266 lat2=0.5593780252641826 x=(-sin(lat1)*cos(lat2)*cos(lon2-lon1)+sin(lat2)*cos(lat1))/(cos(lat2)*sin(lon2-lon1)) z=atan(x) cos(lat2)*sin(lon2-lon1) sinzShort=sin(z) sinzShort sinzLong3=((-sin(lat1)*cos(lat2)*cos(lon2-lon1)+sin(lat2)*cos(lat1)))/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1)))*(cos(lat2)*sin(lon2-lon1)/abs(cos(lat2)*sin(lon2-lon1))) sinzLong3 <a name="draft029"> sinzLong2=((-sin(lat1)*cos(lat2)*cos(lon2-lon1)+sin(lat2)*cos(lat1)))/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1))); sinzLong2 sinzLong1=((-sin(lat1)*cos(lat2)*cos(lon2-lon1)+sin(lat2)*cos(lat1))/(cos(lat2)*sin(lon2-lon1)))/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1))/(cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1))) sinzLong1 <a name="draft030"> 2013-12-01-15-08 verify difference is a '-' sinzShort -0.9473057904253598 sinzLong 0.947305790425359 x -2.957274695235239 <a name="draft031"> 2013-12-01-15-33 above sin(x), below cos(x) 1+x*x= [+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1) +cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1) +cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2) -2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1) ] /[cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1)] <a name="draft032"> cos(z)=1/sqrt(1+x*x) cos(z)=1/sqrt{[+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1) +cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1) +cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2) -2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1) ] /[cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1)]} cos(z)=1/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1))/(cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1))) <a name="draft033"> //2013-12-01-15-37 lon1=2.1211568175904416 lat1=0.437786754041911 lon2=2.072578486743266 lat2=0.5593780252641826 x=(-sin(lat1)*cos(lat2)*cos(lon2-lon1)+sin(lat2)*cos(lat1))/(cos(lat2)*sin(lon2-lon1)) z=atan(x) cos(lat2)*sin(lon2-lon1) coszShort=cos(z) coszShort coszLong1=1/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1))/(cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1))) coszLong1 (lat1,lon1) (lat3,lon3) <a name="draft034"> 2013-12-01-15-41 next are correct sin(z)=((-sin(lat1)*cos(lat2)*cos(lon2-lon1)+sin(lat2)*cos(lat1)))/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1)))*(cos(lat2)*sin(lon2-lon1)/abs(cos(lat2)*sin(lon2-lon1))) cos(z)=1/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1))/(cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1))) <a name="draft035"> great circle through (lat1,lon1) eastRad is //sin(eastRad) == sin(z) eqA(latV,lonV)= -sin(eastRad) *(-cos(latV)*cos(lonV)*sin(lon1) +cos(latV)*sin(lonV)*cos(lon1) ) +cos(eastRad) *(-sin(lat1) *(cos(latV)*cos(lonV)*cos(lon1) +cos(latV)*sin(lonV)*sin(lon1) ) +sin(latV)*cos(lat1) ) <a name="draft036"> where (lat1,lon1) is city1 Latitude Longitude eastRad is at (lat1,lon1) great circle deviate from east angle in radian. (latV,lonV) is a variable point on great circle. (latV,lonV) like (x,y) be unknown. <a name="draft037"> sin(eastRad) == sin(z) cos(eastRad) == cos(z)

On unit sphere, given point1=(lat1,lon1) and given point2=(lat2,lon2) the great circle pass (lat1,lon1) and (lat2,lon2) has next expression where (latV,lonV) is variable point. <a name="draft038"> GCEq1(latV,lonV)= -((-sin(lat1)*cos(lat2)*cos(lon2-lon1)+sin(lat2)*cos(lat1)))/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1)))*(cos(lat2)*sin(lon2-lon1)/abs(cos(lat2)*sin(lon2-lon1))) *(-cos(latV)*cos(lonV)*sin(lon1) +cos(latV)*sin(lonV)*cos(lon1) ) +1 *(-sin(lat1) *(cos(latV)*cos(lonV)*cos(lon1) +cos(latV)*sin(lonV)*sin(lon1) ) +sin(latV)*cos(lat1) )/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1))/(cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1))) <a name="draft039"> red sin(eastRad) is sine of deviation angle of great circle from east at point1=(lat1,lon1) blue is same angle cosine value. If variable point (latV,lonV) value let GCEq1(latV,lonV) get value zero, then (latV,lonV) is on this point1,point2 great circle. <a name="draft040"> GCEq1(latV,lonV)= //next equation not use lat3,lon3 -((-sin(lat1)*cos(lat2)*cos(lon2-lon1)+sin(lat2)*cos(lat1)))/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1)))*(cos(lat2)*sin(lon2-lon1)/abs(cos(lat2)*sin(lon2-lon1)))*(-cos(latV)*cos(lonV)*sin(lon1)+cos(latV)*sin(lonV)*cos(lon1))+1*(-sin(lat1)*(cos(latV)*cos(lonV)*cos(lon1)+cos(latV)*sin(lonV)*sin(lon1))+sin(latV)*cos(lat1))/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1))/(cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1))) All lat1,lon1; lat2,lon2; latV,lonV must use radian, not degree:minute:second. equation not verified, maybe error !! 2013-12-01-16-12

<a name="draft041"> 2013-12-01-16-16 lon1=2.1211568175904416 //point1 lat1=0.437786754041911 //point1 lon2=2.072578486743266 //point2 lat2=0.5593780252641826 //point2 lonV=2.072578486743266 //point2 latV=0.5593780252641826 //point2 ans0=-((-sin(lat1)*cos(lat2)*cos(lon2-lon1)+sin(lat2)*cos(lat1)))/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1)))*(cos(lat2)*sin(lon2-lon1)/abs(cos(lat2)*sin(lon2-lon1)))*(-cos(latV)*cos(lonV)*sin(lon1)+cos(latV)*sin(lonV)*cos(lon1))+1*(-sin(lat1)*(cos(latV)*cos(lonV)*cos(lon1)+cos(latV)*sin(lonV)*sin(lon1))+sin(latV)*cos(lat1))/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1))/(cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1))) ans0 //ans0=GCEq1(latV,lonV) , if ans0=0 then point V is on P1,P2 great circle. 2013-12-01-16-17 ans0 -2.7755575615628914e-17 OK RIGHT !!! <a name="draft042"> 2013-12-01-17-15 above GCEq1 can be used to verify variable point (latV,lonV) is on this point1 (lat1,lon1), point2 (lat2,lon2) great circle or not. above GCEq1 can NOT be used to draw great circle in 3D space. <a name="draft043"> 2013-12-01-18-28 to draw great circle must find great circle center axis (lon0,lat0) value. how to get (lon0,lat0) ? in GCEq1 it has (latV,lonV) two variables. set d(GCEq1)/d(lonV) to zero set d(GCEq1)/d(latV) to zero two equation solve for two unknown (lon0,lat0) 2013-12-01-18-31 <a name="draft044"> GCEq1(latV,lonV)= -((-sin(lat1)*cos(lat2)*cos(lon2-lon1)+sin(lat2)*cos(lat1)))/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1)))*(cos(lat2)*sin(lon2-lon1)/abs(cos(lat2)*sin(lon2-lon1))) *(-cos(latV)*cos(lonV)*sin(lon1) +cos(latV)*sin(lonV)*cos(lon1) ) +1 *(-sin(lat1) *(cos(latV)*cos(lonV)*cos(lon1) +cos(latV)*sin(lonV)*sin(lon1) ) +sin(latV)*cos(lat1) )/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1))/(cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1))) <a name="draft045"> M91=-((-sin(lat1)*cos(lat2)*cos(lon2-lon1)+sin(lat2)*cos(lat1)))/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1)))*(cos(lat2)*sin(lon2-lon1)/abs(cos(lat2)*sin(lon2-lon1))) M92=1/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1))/(cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1))) GCEq1(latV,lonV)= M91 *(-sin(lon1)*cos(latV)*cos(lonV) +cos(lon1)*cos(latV)*sin(lonV) ) +M92*(-sin(lat1)*cos(lon1)*cos(latV)*cos(lonV) -sin(lat1)*sin(lon1)*cos(latV)*sin(lonV) +cos(lat1)*sin(latV) ) <a name="draft046"> M91=-((-sin(lat1)*cos(lat2)*cos(lon2-lon1)+sin(lat2)*cos(lat1)))/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1)))*(cos(lat2)*sin(lon2-lon1)/abs(cos(lat2)*sin(lon2-lon1))) M92=1/sqrt((+sin(lat1)*sin(lat1)*cos(lat2)*cos(lat2)*cos(lon2-lon1)*cos(lon2-lon1)+cos(lat2)*cos(lat2)*sin(lon2-lon1)*sin(lon2-lon1)+cos(lat1)*cos(lat1)*sin(lat2)*sin(lat2)-2*sin(lat1)*cos(lat1)*sin(lat2)*cos(lat2)*cos(lon2-lon1))/(cos(lat2)*sin(lon2-lon1)*cos(lat2)*sin(lon2-lon1))) M1=-sin(lon1)*M91 M2=+cos(lon1)*M91 M3=-M92*sin(lat1)*cos(lon1) M4=-M92*sin(lat1)*sin(lon1) M5=+M92*cos(lat1) <a name="draft047"> //GCEq1(latV,lonV)= gceq1a=M1*cos(latV)*cos(lonV) +M2*cos(latV)*sin(lonV) +M3*cos(latV)*cos(lonV) +M4*cos(latV)*sin(lonV) +M5*sin(latV) gceq1a 2013-12-01-18-58 verified gceq1a is correct. see colde at //a212011847 //a212011848 Above is useful 2013-12-01-19-40 Below is not useful (work in vain) <a name="draft048"> d(gceq1a)/d(latV)= -M1*sin(latV)*cos(lonV) -M2*sin(latV)*sin(lonV) -M3*sin(latV)*cos(lonV) -M4*sin(latV)*sin(lonV) +M5*cos(latV)=0 ---eq.gc01 <a name="draft049"> d(gceq1a)/d(lonV)= -M1*cos(latV)*sin(lonV) +M2*cos(latV)*cos(lonV) -M3*cos(latV)*sin(lonV) +M4*cos(latV)*cos(lonV) +0=0 ---eq.gc02 from eq.gc01 and eq.gc02 it is impossible to solve for latV and lonV 2013-12-01-19-48 <a name="draft050"> 2013-12-01-19-50 goto xyz Cartesian coordinate (x1,y1,z1) is given (x2,y2,z2) is given (x3,y3,z3) is unknown x1=cos(lat1)*cos(lon1) y1=cos(lat1)*sin(lon1) z1=sin(lat1) x2=cos(lat2)*cos(lon2) y2=cos(lat2)*sin(lon2) z2=sin(lat2) (x3,y3,z3)dot(x1,y1,z1)=0 (x3,y3,z3)dot(x2,y2,z2)=0 (x3,y3,z3).length=1 <a name="draft051"> x3*cos(lat1)*cos(lon1)+y3*cos(lat1)*sin(lon1)+z3*sin(lat1)=0 ---eq.gc03 x3*cos(lat2)*cos(lon2)+y3*cos(lat2)*sin(lon2)+z3*sin(lat2)=0 ---eq.gc04 x3*x3+y3*y3+z3*z3=1 ---eq.gc05 eq.gc03 and eq.gc04 are linear eq.gc05 is quadratic <a name="draft052"> x3*cos(lat1)*cos(lon1)+y3*cos(lat1)*sin(lon1)=-z3*sin(lat1) ---eq.gc06 x3*cos(lat2)*cos(lon2)+y3*cos(lat2)*sin(lon2)=-z3*sin(lat2) ---eq.gc07 [ cos(lat1)*cos(lon1) cos(lat1)*sin(lon1) ]*[x3]=[-z3*sin(lat1)] ---eq.gc08 [ cos(lat2)*cos(lon2) cos(lat2)*sin(lon2) ]*[y3]=[-z3*sin(lat2)] <a name="draft053"> deno= cos(lat1)*cos(lon1)*cos(lat2)*sin(lon2) -cos(lat1)*sin(lon1)*cos(lat2)*cos(lon2) ---eq.gc09 num1=-z3*sin(lat1)*cos(lat2)*sin(lon2) +z3*sin(lat2)*cos(lat2)*cos(lon2) ---eq.gc10 num2=-cos(lat1)*cos(lon1)*z3*sin(lat1) +cos(lat1)*sin(lon1)*z3*sin(lat2) ---eq.gc11 <a name="draft054"> x3=num1/deno ---eq.gc12 y3=num2/deno ---eq.gc13 substitute eq.gc12 and eq.gc13 to eq.gc05 solve for z3. this is also an impossible path. 2013-12-01-20-11 <a name="draft055"> 2013-12-01-20-20 if take (latV,lonV) as unknown, it is impossible to solve. if take (sin(lonV),sin(latV)) as unknown, is it simpler to solve? <a name="draft056"> 2013-12-01-20-23 gceq1a=M1*cos(latV)*cos(lonV) +M2*cos(latV)*sin(lonV) +M3*cos(latV)*cos(lonV) +M4*cos(latV)*sin(lonV) +M5*sin(latV) ---gceq1a <a name="draft057"> set sin(lonV)=s ---eq.gc14 cos(lonV)=t ---eq.gc15 sin(latV)=u ---eq.gc16 cos(latV)=v ---eq.gc17 with s*s+t*t=1 ---eq.gc18 u*u+v*v=1 ---eq.gc19 <a name="draft058"> gceq1b=M1*v*t +M2*v*s +M3*v*t +M4*v*s +M5*u ---gceq1b gceq1c=M1*v*t+M2*v*s+M3*v*t+M4*v*s+M5*u +p*(s*s+t*t-1)+q*(u*u+v*v-1)---gceq1c <a name="draft059"> 2013-12-01-20-30 d(gceq1c)/d(s)=0 ---eq.gc20 d(gceq1c)/d(t)=0 ---eq.gc21 d(gceq1c)/d(u)=0 ---eq.gc22 d(gceq1c)/d(v)=0 ---eq.gc23 d(gceq1c)/d(p)=0 ---eq.gc24 d(gceq1c)/d(q)=0 ---eq.gc25 <a name="draft060"> d(gceq1c)/d(s)=0 0+M2*v+0+M4*v+0+2*s*p=0 ---eq.gc26 d(gceq1c)/d(t)=0 M1*v+0+M3*v+0+0+2*t*p=0 ---eq.gc27 d(gceq1c)/d(u)=0 0+M5+2*q*u=0 ---eq.gc28 <a name="draft061"> d(gceq1c)/d(v)=0 M1*t+M2*s+M3*t+M4*s+0+2*q*v=0 ---eq.gc29 d(gceq1c)/d(p)=0 s*s+t*t-1=0 ---eq.gc30 d(gceq1c)/d(q)=0 u*u+v*v-1=0 ---eq.gc31 <a name="draft062"> all six equations M2*v+M4*v+2*s*p=0 ---eq.gc26 M1*v+M3*v+2*t*p=0 ---eq.gc27 M5+2*q*u=0 ---eq.gc28 M1*t+M2*s+M3*t+M4*s+2*q*v=0 ---eq.gc29 s*s+t*t=1 ---eq.gc30 u*u+v*v=1 ---eq.gc31 <a name="draft063"> from eq.gc26 s=-v*(M2+M4)/2/p ---eq.gc32 from eq.gc27 t=-v*(M1+M3)/2/p ---eq.gc33 from eq.gc28 u=-M5/2/q ---eq.gc34 <a name="draft064"> from M1*t+M2*s+M3*t+M4*s+2*q*v=0 ---eq.gc29 find v v=(-t*(M1+M3)-s*(M2+M4))/2/q ---eq.gc35 v=(v*((M1+M3)/2/p)*(M1+M3) +v*((M2+M4)/2/p)*(M2+M4))/2/q ---eq.gc36 in eq.gc36 v cancel out !!?? 2013-12-01-21-05 <a name="draft065"> 2013-12-04-21-21 delete from 2013-12-01-21-05 to 2013-12-04-11-06 notes, because those notes can not find great circle center.
<a name="source01"> Liu,Hsinhan first great circle equation reading come from [[ Using great circles to understand motion on a rotating sphere D. H. McIntyre Department of Physics, Oregon State University, Corvallis, Oregon 97331 Received : 28 January 2000 ]] <a name="source02"> 2013-12-05-17-28 open 9409HP19.DLY [[[[[ 2005-07-26-19-24-17 https://commerce.aip.org/servlet/lookup6?cvips=AJPIAS000068000012001097000001 C:\$fm\ph\Coriolis\Coriolis-orst-aip.org-buy01.htm <a name="source03"> 2005-09-23-12-54-36 in http://scholar.google.com/ ask How to determine a big circle if given two points on sphere? get Scholar Results 1 - 10 of about 12,600 for How to determine a big circle if given two points on sphere?. (0.20 seconds) <a name="source04"> [[ 2005-07-26-19-24-17 https://commerce.aip.org/servlet/lookup6?cvips=AJPIAS000068000012001097000001 C:\$fm\ph\Coriolis\Coriolis-orst-aip.org-buy01.htm 07/26/2005 07:26 PM 15,877 Coriolis-orst-aip.org-buy01.htm ]] 2005-07-26-19-24-17 <a name="source05"> 2005-09-23-15-59-31 https://commerce.aip.org/servlet/lookup6?cvips=AJPIAS000068000012001097000001 2005-09-23-16-01-09 https://webmail.pas.earthlink.net/wam/login.jsp?redirect=%2Fwam%2Findex.jsp&x=719572320 [[ Email Address: Liu_name_aO_earthlink.net (eg. your_address_aO_earthlink.net) Password: Remember my email login on this computer. View list of supported domains Forgot your password? Known Issues In the Beta ]] <a name="source06"> 2005-09-23-16-03-35 login success back to https://commerce.aip.org/jsp/Lookup.jsp?item=AJPIAS000068000012001097000001&ident=null&src=null [[ Using great circles to understand motion on a rotating sphere D. H. McIntyre Department of Physics, Oregon State University, Corvallis, Oregon 97331 Received : 28 January 2000 Abstract ..... Association of Physics Teachers. Purchase Price: $ 18.50 US ..... To purchase the full-text PDF of this article, please fill out the payment information below and click the BUY button. <a name="source07"> P A Y M E N T I N F O R M A T I O N Note : All fields are required Credit Card Type Select a type MasterCard American Express Visa Visa Name as it appears on Credit Card HSIN HAN LIU Credit Card Number 1234 4321 5678 8765 Expiration Date 01 02 03 04 05 06 07 08 09 10 11 12 2004 2005 2006 2007 2008 2009 2010 2011 2012 Email Address Liu_name_aO_earthlink.net By purchasing this article I have agreed to the Terms of Use. Privacy Policy. Purchase Price: $ 18.50 US W H A T T O E X P E C T <a name="source08"> When you click the Buy button your credit card information will be processed. If the information you have provided is accurate, you will be taken to the success screen which will display a link to your PDF document. Be certain to click the download button on the next screen. This will download the PDF to your computer and will also email a PDF copy of the article to the email address you provided. This article is also available offline. Order Offline If, at any time you are having difficulty using the system, or if you simply need help please contact us in one of the following ways: Via e-mail: help_aO_scitation_dot_org Via telephone (U. S. and Canada): 1-800-874-6383 Via telephone (all other locations): 1-516-576-2664 Customer service office hours are currently from 07:30 to 23:00 Eastern (U. S.) Time (13:30 to 04:00 GMT). ]] 2005-09-23-16-11-50 click to buy get <a name="source09"> https://commerce.aip.org/theamericaninstituteofphysi-66/mck-cgi/directpaycredit.cgi [[ No Success Your credit card was not charged Your order id number was: ********** The error message returned was: Location: ; Message: Click the "Back" button and try again. ]] <a name="source10"> both Location: ; Message: are empty 2005-09-23-16-13 click "back" change from Credit Card Number 1234 4321 5678 8765 to Credit Card Number 1234432156788765 <a name="source11"> 2005-09-23-16-15-32 click to buy https://commerce.aip.org/theamericaninstituteofphysi-66/mck-cgi/directpaycredit.cgi c:\$fm\ph\Coriolis\buy940923a.htm [[ Success! View/Save Your Article Now OR to save the article to your computer, right click (PC,UNIX) or hold (MAC) the "View Article" button and choose "Save Link As..." (make sure you use the file extension, ".pdf") Later Or Additional Download Of This Article https://commerce.aip.org/jsp/reget.jsp Billing <a name="source12"> Your credit card was charged: $usd 18.50 Order Number 05092318593225 Please write this number down or print this page. You will need this number to access the PDF within the next 24 hours or to contact customer service. Customer Service If, at any time you are having difficulty using the system, or if you simply need help please contact us in one of the <a name="source13"> following ways: Via e-mail: onlinehelp_aO_aip_dot_org Via telephone (U. S. and Canada): 1-800-874-6383 Via telephone (all other locations): 1-516-576-2664 Via FAX: 1-516-576-2604 Customer service office hours are currently from 07:30 to 23:00 Eastern (U. S.) SCITATION HOME PROLA HOME ]] <a name="source14"> 2005-09-23-16-19-24 https://commerce.aip.org/jsp/reget.jsp c:\$fm\ph\Coriolis\buy940923b.htm [[ Retrieve Your Article You can retrieve the article(s) you purchased for up to 24 hours. You will need your order number given to you at the time of purchase. If you do not have your order number, please contact Customer Service at: 1-800-874-6383 - E-mail: help_aO_scitation_dot_org Please enter your order number: 05092318593225 "Show PDF" Find Your Article Again Using Email If you have forgotten your order number, enter your email address below and the pertinent information will be emailed to you. Enter your email address "Email my order number" ]] <a name="source15"> 2005-09-23-16-22-55 click "Show PDF" https://commerce.aip.org/pdfs/05092318593225_AJPIAS000068000012001097000001.pdf 2005-09-23-16-23-42 save as c:\$fm\ph\Coriolis\paid$18a.pdf 09/23/2005 04:23 PM 506,114 paid$18a.pdf after save paid$18a.pdf to my computer, msie window become all blank ]]]]]
<a name="scircle01"> Small circle VARY FACE equation is next sin(angEarth) *(cos(lam1Lat) *( cos(Var0Lat)*cos(Var0Lon)*cos(phi1Lon) +cos(Var0Lat)*sin(Var0Lon)*sin(phi1Lon) ) +sin(Var0Lat)*sin(lam1Lat) ) + cos(angEarth) *(-sin(eastRad) *(-cos(Var0Lat)*cos(Var0Lon)*sin(phi1Lon) +cos(Var0Lat)*sin(Var0Lon)*cos(phi1Lon) ) +cos(eastRad) *(-sin(lam1Lat) *(cos(Var0Lat)*cos(Var0Lon)*cos(phi1Lon) +cos(Var0Lat)*sin(Var0Lon)*sin(phi1Lon) ) +sin(Var0Lat)*cos(lam1Lat) ) ) - sin(angEarth) = 0 <a name="scircle02"> Above is point-on-circle-based equation. (Vary face equation) Which varies when point (first city) change location. Below is polar-point-based equation.(Constant face equation) Polar-point never change for a given circle. xp*[cos(Var0Lon)*cos(Var0Lat)] +yp*[sin(Var0Lon)*cos(Var0Lat)] +zp*[sin(Var0Lat)] -sin(angEarth)=0 What is xp,yp,zp,Var0Lon,Var0Lat? Please click to see document. 2006-05-02-15-16 http://freeman2.com/jscircl2.htm#SCDoc01 local <a name=note_end> Latitude Longitude inpPoint123,box11,box12,box13,docA001 Link:


<a name=JSMathFunc>





Link:
Javascript index
http://freeman2.com/jsindex2.htm   local
Save graph code to same folder as htm files.
http://freeman2.com/jsgraph2.js   local


Small circle equation/locus 2006-05-11
http://freeman2.com/jscircl2.htm   local

Great circle equation/locus 2006-04-26
http://freeman2.com/jscircle.htm   local

This file gcircle2.htm is created on 2013-11-30

This page URL
http://freeman2.com/gcircle2.htm
Chinese version URL
http://freeman2.com/gcircle1.htm
First upload 2013-12-12

Thank you for visiting Freeman's web site
Freeman Liu,Hsinhan 劉鑫漢 2013-12-12-20-14
Link: