honky
Junior Member
Posts: 63
|
Post by honky on Mar 17, 2024 3:13:46 GMT -5
I abandoned Chrome for Firefox because Chrome stuffed my disc with I don't know what useless. I do not know if this incomplete has been settled
|
|
honky
Junior Member
Posts: 63
|
Post by honky on Mar 18, 2024 4:29:31 GMT -5
I added things to your code. "Save BMP" and: "Point size" must be set before "Start". To get the 33 BMPs, you have to wait until the animation had a full tour. "Stop" and right click-> gives GPS contact details. But the coordinates (approached) of the right click in Paris Say: 0.10152469 and: 1.118146701 While Google says: X: 48 ° 52 '0.01 "Y: 2 ° 19' 59.99". Tokio: 2.02138686--1.18146701 Google: 35.689487--139.691706
(The calculation is in [coord], (first sub-program). What do I hurt? nomainwin WindowWidth =900: WindowHeight =740 graphicbox #w.g, 1, 1, 898, 738 button #w.a, "Save bmps ",save, UL, 20, 10, 120, 25 textbox #w.f, 160, 10, 30, 20 button #w.e, "Start",[start], UL, 200, 10, 50, 20 button #w.b, "Stop",sto, UL, 260, 10, 50, 20 button #w.c, "Go",[reme], UL, 320, 10, 50, 20 button #w.d, "Grid",gri, UL, 380, 10, 50, 20 textbox #w.h, 625, 10, 30, 20 textbox #w.i, 625, 36, 30, 20 textbox #w.j, 625, 62, 30, 20 textbox #w.k, 625, 87, 30, 20 open "World Views" for window as #w #w "trapclose quit" #w.g, "when rightButtonDown [coord]" global pi: pi =3.14159265 global twoPi: twoPi =2 *pi global sav: global sto: global gri #w.a, "!font courrier 10 bold": #w.e, "!font courrier 10 bold" #w.b, "!font courrier 10 bold": #w.c, "!font courrier 10 bold" #w.d, "!font courrier 10 bold": #w.h, "!font courrier 10 bold" #w.i, "!font courrier 10 bold": #w.j, "!font courrier 10 bold" #w.k, "!font courrier 10 bold" R =300 ' RADIUS OF GRAPHIC IN SCREEN PIXELS 'L0 = 80 ' LONGITUDE OF OBSERVER IN DEGREES. #w.g, "down;color red;size 8": #w.g, "set 665 20": #w.g, "color black" #w.g, "place 675 20": #w.g, "\Red point=Population > 1E7" #w.g, "color yellow;size 7": #w.g, "set 665 45": #w.g, "color black" #w.g, "place 675 45": #w.g, "\Yellow point=Population > 1E6" #w.g, "color green;size 7": #w.g, "set 665 70": #w.g, "color black" #w.g, "place 675 70": #w.g, "\Green point=Population > 1E5" #w.g, "color cyan;size 7": #w.g, "set 665 95": #w.g, "color black" #w.g, "place 675 95": #w.g, "\Cyan point=Population < 1E5" sh=3: #w.h, str$(sh): si=1: #w.i, str$(si): sj=1: #w.j, str$(sj): sk=1: #w.k, str$(sk) wait [coord] xx=MouseX: yy=MouseY LL=acs(X/R1): PP=acs(Y/R) #w.g, "color white;backcolor 60 60 60" #w.g, "place ";xx;" ";yy: #w.g, "\ ";str$(LL) #w.g, "place ";xx;" ";yy+20: #w.g, "\ ";str$(PP) wait [start] #w.h, "!contents? sh$": sh=val(sh$): #w.i, "!contents? si$": si=val(si$) #w.j, "!contents? sj$": sj=val(sj$): #w.k, "!contents? sk$": sk=val(sk$) if sh > 3 then sh=3: if si > 3 then si=3: if sj > 3 then sj=3: if sk > 3 then sk=3 if sh < 1 then sh=1: if si < 1 then si=1: if sj < 1 then sj=1: if sk < 1 then sk=1
#w.a, "!disable": #w.f, "!disable": nn=0 for L0 =0 to 360 step 10 if sto=1 then wait [rema] #w.b, "!enable" #w.g "cls ; goto 450 350 ; down ; fill 60 60 60 ; size 1" #w.g " color white ; circle 300 ;color white ; size 1 ; down; flush" ' Add loop through range of P and LA to generate screen grid of lat /lon [grid] if gri=1 then [passgri] for lat =-90 to 90 step 10 ' BOTH IN DEGREES. EAST OF MERIDIAN +ve. NORTH +ve. for long = -180 to 180 step 10 L =long P =lat '#w.g "set "; int( 450 +2 *long); " "; int( 350 +3 *lat) gosub [findPoint] next long next lat [passgri] #w.g "flush" [dataShow] #w.g "color 180 180 100 ; size 2" open "LatLon2.txt" for input as #fIn line input #fIn, g$ for k =2 to 7343 line input #fIn, g$ L =val( word$( g$, 2, ",")) P =val( word$( g$, 1, ",")) pop =val( word$( g$, 3, ",")) gosub [findPoint] next k close #fIn #w.g "flush" #w.g "getbmp scr 1 1 898 738" if sav=1 then bmpsave "scr", "globe-" +right$( "000" +str$( L0), 3) +".bmp" end if scan nn=nn+1 #w.f, str$(nn) next L0 wait [reme] sto=0: goto [rema] wait [findPoint] ' SUBROUTINE TO COMPUTE MAP COORDINATES FOR ORTHOGRAPHIC EQUATORIAL PROJECTION.
' THE FOLLOWING VARIABLES MUST BE DEFINED BEFORE THIS SUBROUTINE IS CALLED: ' P IS THE GEOGRAPHIC LATITUDE IN DEGREES OF THE POINT BEING CONVERTED. ' L IS THE GEOGRAPHIC LONGITUDE IN DEGREES OF THE POINT BEING CONVERTED. ' R IS THE RADIUS OF THE FINISHED MAPS IN PIXELS.
' THE FOLLOWING VARIABLES ARE COMPUTED BY THIS SUBROUTINES ' S IS THE OFF-SCALE FLAG. S =0 MEANS ON-SCALE S =1 MEANS OFF-SCALE. ' R1 IS TEMPORARY STORAGE. ' X 1S THE MAP X-COORDINATE IN PIXELS. ' Y IS THE MAP Y=COORDINATE IN PIXELS. S = 0 ' ROTATE THE GEOGRAPHIC LONGITUDE OF THE POINT FROM THE DATA BASE TO REFERENCE IT TO THE MAP CENTER LONGITUDE ' AND CONVERT TO RADIANS. L = ( L -L0) *pi /180 P = P *pi /180 ' NORMALIZE THE ROTATED LONGITUDE BETWEEN ~180 DEGREES AND +180 DEGREES (-PI AND +PI) IF L >pi THEN L = L - twoPi IF L <( 0 -pi) THEN L = L + twoPi ' IF OFF-SCALE (OUTSIDE THE RANGE FROM -P1/2 TO +pi/2 SET FLAG AND RETURN IF L <( 0 -pi /2) THEN S = 1: RETURN IF L >( pi /2) THEN S = 1: RETURN ' COMPUTE THE MAP COORDINATES FROM THE GEOGRAPHIC COORDINATES. ' L IN RANGE -pi/2..pi/2 P IN RANGE -pi/pi. R1 = R * sin( ( pi /2 -abs( P))) X = R1 * sin( L) Y = R * sin( P) LL=acs(X/R1): PP=acs(Y/R) select case case pop >1E7 col$ ="red": size =sh case pop >1E6 col$ ="yellow": size =si case pop >1E5 col$ ="green": size =sj case else col$ ="cyan": size =sk end select #w.g "color "; col$ #w.g "size "; size #w.g "set "; int( 450 +X); " "; int( 350 -Y) RETURN END sub save buttonhandle$ sav=1 end sub sub sto buttonhandle$ sto=1: #w.b, "!disable" end sub sub gri buttonhandle$ gri=gri+1 if gri>1 then gri=0 end sub sub quit h$ close #h$ end end sub
|
|
|
Post by tenochtitlanuk on Mar 18, 2024 9:01:51 GMT -5
It's well worth playing to add things to the code. You've some good ideas to give it an interactive GUI front end . . . I'll follow your changes with interest.
Yes, you obviously don't get all the images saved unless you allow a full run first. It's a way to make a suitable speed animation to display, since LB is much slower than other languages.
Do you really have a ( French) font called 'courrier'? I'm only aware of 'Courier'. And if you specify a font for the window #w, all buttons eg #w.b1 pick the chosen font without you having to tell each one- unless you want different sizes.
I did warn that the original BYTE code was wrong in parts. You need to be very clear where you are working in degrees OR radians, and in screen coordinates. It took me ages to sort out in my version.
Haven't time at present to see why your code doesn't work correctly- I'm away from home for a while.
I'll be concentrating on the polar equidistant and orthographic polar projections when I have time. Did you look at the BYTE article? It gives us a base to work on...
J
|
|
honky
Junior Member
Posts: 63
|
Post by honky on Mar 18, 2024 10:18:52 GMT -5
I think your data is not in the same format as that of Google which are in degrees. How are yours? Yes, the fonts of the buttons and textbox must be optimized,
|
|
honky
Junior Member
Posts: 63
|
Post by honky on Mar 20, 2024 3:38:10 GMT -5
I think I'm totally "in the cabbage" with my fomules. LL = ACS (X/R1): PP = ACS (Y/R) R1 and R have nothing to do in the calculation. Longitude depends on the rotation step number and X * coefficient. Latitude depends on Y * coefficient taking into account the sphericity. We must think... To target the precision is illusory is for the challenge.
|
|
|
Post by tenochtitlanuk on Mar 29, 2024 13:43:40 GMT -5
Have added a GUI front end. I've also located a database of coastal points- but being 12* bigger it makes processing slower- and when you zoom down you start to realise how BIG our globe is! Not finished yet. Several planned alterations /additions.
|
|
|
Post by tsh73 on Mar 29, 2024 14:50:14 GMT -5
Hello John Probably then zooming round view edge does not have sence any more? Wonder of coastal points are in order (that is could be joined by line) It will help recogizing stuff then zoomed.
|
|
|
Post by tenochtitlanuk on Mar 29, 2024 17:42:09 GMT -5
Anatoly- sadly the database mixes point data and data corresponding to feature boundaries, in sections, but all unseparable in the csv file since there id no 'end of section' marker. So no way to know when you are moving to a new section, and need to lift the pen and then lower for the new section. Result is a whole lot of incorrect joining lines...
Vector file formats are available that cover this but they are hard to decipher- you can load them into a GIS like the ( free) QGIS, but the kind of customised projections I am interested in are not catered for there.
Similarly, the lat/longitude would be better shown with points connected by straight lines, but this gives problems at the boundaries. But I may implement a method of plotting close together dots between the existing spaced dots.
The 'zoom view' DOES have a round boundary. Think looking down on Baikonur from 100km, or down from a Starship return-landing approach. The horizon is equidistant in all directions. It's not the same as enlarging a section of the 'view from infinity'.
|
|
honky
Junior Member
Posts: 63
|
Post by honky on Mar 30, 2024 5:22:37 GMT -5
Very interesting, can I have the code ?
|
|
|
Post by tenochtitlanuk on Mar 30, 2024 6:01:15 GMT -5
Current version and the new database will be on my site in a few days.
It's a fun area with lots of possibilities.
Bit busy over Easter...
|
|
honky
Junior Member
Posts: 63
|
Post by honky on Mar 30, 2024 9:03:56 GMT -5
So we will wait.
|
|
|
Post by tsh73 on Mar 30, 2024 14:05:01 GMT -5
|
|
|
Post by tenochtitlanuk on Mar 30, 2024 16:56:14 GMT -5
Looks worth a try. I'll add to my list of things to try!
|
|
|
Post by tenochtitlanuk on Apr 1, 2024 9:55:41 GMT -5
Fairly happy now... watch the Earth's heartbeat!
|
|
|
Post by tenochtitlanuk on Apr 2, 2024 15:16:24 GMT -5
See link to zip fileTo be fair, most of the scanned BYTE pages were better than this one! Will do full page too on my web site asap. . . with some scans to show how much work this took!
|
|