--- title: "Halley’s Comet Redux" type: "article" slug: "halleys-comet-redux" url: "http://localhost/article/halleys-comet-redux/" markdown_url: "http://localhost/article/halleys-comet-redux.md" published_at: "2022-09-14T02:41:25+00:00" modified_at: "2024-05-26T13:09:53+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Short program that plots the orbit of Halley's Comet, starting in 1986. Typed in by Tim Swenson." category: - name: "CATS Newsletter" slug: "cats-newsletter" taxonomy: "category" url: "http://localhost/category/periodicals/cats-newsletter/" post_tag: - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Roald Schrack" slug: "roald-schrack" taxonomy: "indiv" url: "http://localhost/indiv/roald-schrack/" publication_r: id: 35941 title: "CATS Newsletter" type: "periodical" url: "http://localhost/periodical/cats-newsletter/" authors: "Roald Schrack" volume: "4" issue: "3" issues_articles: - id: 39614 title: "CATS v4 n3" type: "issue" url: "http://localhost/issue/cats-v4-n3/" pages: "7" pubdate: "June 1986" archive_link: false article_media: - id: 51939 title: "Halley’s Comet" type: "computer_media" url: "http://localhost/computer_media/halleys-comet/" --- # Halley’s Comet Redux Short program that plots the orbit of Halley’s Comet, starting in 1986. Typed in by Tim Swenson. ## Source Code: Halley’s Comet ``` 1 REM Halley's Comet Redux 2 REM Roald Schrack 3 REM CATS Newsletter v4 n3 4 REM https://archive.org/details/cats-newsletter/CATS%20v4%20n3%20Jun%201986/page/7/mode/1up 5 REM Typed by Tim Swenson 10 REM ** Halley's Comet ** 50 CLS 60 CIRCLE 10,85,1 100 FOR j=1 TO 6 110 READ n$,p,r 120 LET pz=p 130 LET p=-p 140 LET x=r*COS p+10 150 LET y=r*SIN p+85 160 PLOT x,y 170 IF p>pz THEN GO TO 200 180 LET p=p+3/r 190 GO TO 140 200 PRINT AT 22-y/8,x/8;n$ 210 NEXT j 220 DATA "E",3.14,7,"J",1.73,31,"S",1.48,58,"U",.82,116,"N",.49,180,"p",.37,234 230 LET tz=0 240 LET p=0 245 PRINT AT 20,1;"It is ";1986;". Halley's comet is" 250 LET p=p+.008 260 LET t=12.12*(p-.9673*SIN p) 270 IF t>tz+1 THEN GO TO 290 290 LET x=107.4*(.9673-COS p)+10 300 LET y=27.2*SIN p+85 302 IF p>6.28318 THEN STOP 304 LET d=15.6E6*SQR ((x-10)*(x-10)+(y-85)*(y-85)) 306 PRINT AT 21,1;d;" miles from the sun" 310 PLOT x,y 312 IF t>tz+1 THEN GO TO 320 315 GO TO 250 320 PRINT AT 20,7;tz+1987 330 LET tz=tz+1 340 GO TO 250 ```