Astrological Aspect Calculation Program, in BASIC

This routine allows you to successively input the placements of your luminaries, planets, Ascendant and Midheaven by signs and degrees. It then automatically calculates and displays all aspects found between the factors concerned, showing the names of the aspects found and how close to exact they are to the nearest tenth of a degree.

Part One: the Program

5@%=&20109

10*TV255

20CLEAR

30DIMA$(12),A(12),B$(38),B(38),C(38),E(38)

40RESTORE360:FORI%=1TO12:READA$(I%),A(I%):NEXT:FORI%=1TO38:READB$(I%),B(I%),C(I%)

50IFI%=1_E(I%)=0:NEXT

60IFI%=38_E(I%)=180:NEXT

70IFI%<38ANDI%>1_E(I%)=(B(I%)+((C(I%)-B(I%))/2)):NEXT

80DIMP$(14),S$(14),D(14):RESTORE400:FORI%=1TO14:READP$(I%):NEXT

90MODE7:PRINT’

100FORI%=1TO14:K%=I%:IFK%>12K%=K%-12ELSEIFK%>6K%=K%-6

110REPEAT:PRINTCHR$(128+K%);”Please_enter_”;P$(I%);”_sign”;:INPUTS$(I%)

120UN.LE.S$(I%),2)=”AR”ORLE.S$(I%),2)=”TA”ORLE.S$(I%),2)=”GE”ORLE.S$(I%),3)=”CAN”ORLE.S$(I%),2)=”LE”ORLE.S$(I%),2)=”VI”ORLE.S$(I%),2)=”LI”ORLE.S$(I%),2)=”SC”ORLE.S$(I%),2)=”SA”ORLE.S$(I%),3)=”CAP”ORLE.S$(I%),2)=AQ”ORLE.S$(I%),2)=”PI”

130REPEAT:PRINTCHR$(128+K%);”Please_enter_”P$(I%);”_degree”;:INPUTD(I%):UNTILD(I%)>=0AND_D(I%)<=30:NEXT

140DIMSI$(14)

150FORI%=1TO14:IFLEFT$(S$(I%),2)=”AR”SI$(I%)=A$(1):S%=1ELSEIFLEFT$(S$(I%),2)=”TA”SI$(I%)=A$(2):S%=2ELSEIFLEFT$(S$(I%),2)=”GE”SI$(I%)=A$(3):S%=3ELSEIFLEFT$(S$(I%),3)=”CAN”SI$(I%)=A$(4):S%=4ELSEIFLEFT$(S$(I%),3)=”CAP”SI$(I%)=A$(10):S%=10

160IFLEFT$(S$(I%),2)=”LE”SI$(I%)=A$(5):S%=5ELSEIFLEFT$(S$(I%),2)=”VI”SI$(I%)=A$(6):S%=6ELSEIFLEFT$(S$(I%),2)=”LI”SI$(I%)=A$(7):S%=7ELSEIFLEFT$(S$(I%),2)=”SC”SI$(I%)=A$(8):S%=8ELSEIFLEFT$(S$(I%),2)=”SA”SI$(I%)=A$(9):S%=9

170IFLEFT$(S$(I%),2)=”AQ”SI$(I%)=A$(11):S%=11ELSEIFLEFT$(I%),2)=”PI”SI$(I%)=A$(12):S%=12

180IFI%<=14_D(I%)=D(I%)+A(S%):NEXT

190DIM_G(90),F(90),T(90),U(90),V(90),T$(90),U$(90),V$(90),O(90),Y(90)

200RESTORE410:FORI%=1TO90:READU(I%),V(I%):U$(I%)=P$(U(I%)):V$(I%)=P$(V(I%)):G(I%)=D(U(I%)):F(I%)=D(V(I%))

210IFI%<=90AND_G(I%)>(180+F(I%))F(I%)=F(I%)+360:GOTO220_ELSE_IF_I%<=90AND_F(I%)>(180+G(I%))G(I%)=G(I%)+360:GOTO220

220IFG(I%)>=F(I%)T(I%)=G(I%)-F(I%)

230IFG(I%)<F(I%)T(I%)=F(I%)-G(I%)

240FORJ%=1TO38:IFT(I%)>=B(J%)ANDT(I%)<=C(J%)T$(I%)=B$(J%):Y(I%)=2:Z%=2

250IFZ%=2ANDT(I%)>=E(J%)O(I%)=T(I%)-E(J%)

260IFZ%=2ANDT(I%)<E(J%)O(I%)=E(J%)-T(I%)

270Z%=1:NEXT

280IFY(I%)<>2T$(I%)=”not_aspecting”:NEXT_ELSENEXT

290H%=0:CLS

300FORI%=1TO90:IFI%>90END_ELSEK%=I%:REPEAT:IFK%>6K%=K%-6:UNTILK%<7

310IFY(I%)<>2ANDI%=90END

320IFY(I%)<>2NEXT

330IFY(I%)=2H%=H%+1:PRINTCHR$((128+K%));U$(I%);”_”;T$(I%);”_”;V$(I%);”_”;O(I%):IFH%=20ORH%=40ORH%=60PRINT’CHR$((128+K%));”Hit_any_key_to_continue”:H$=GET$:CLS

340IFI%=90END

350NEXT

360DATA”ARIES”,0,”TAURUS”,30,”GEMINI”,60,”CANCER”,90,”LEO”,120,”VIRGO”,150,”LIBRA”,180,“SCORPIO”,210,”SAGITTARIUS”,240,”CAPRICORN”,270,”AQUARIUS”,300,”PISCES”,330

370DATA”Conjunct”,0,9,”Quartisextile”,14.5,15.5,”Seminovile”,19.6,20.4,”Quartisquare”,21.7,23.3,”Semiseptile”,25.4,26.0,”Semisextile”,28.5,31.5,”Undecile”,32.4,33.1,”Decile”,35.4,36.6,“Novile”,39,41,”Semisquare”,42.8,47.2

375DATA”Septile”,50.5,52.3,”Sextile”,57,63,”Biundecile”,65.1,65,8,”Triquartisquare”,66.7,68.3,”Quintile”,70.2,73.8

380DATA”Quintaquartisextile”,74.5,77.5,”Trisemiseptile”,76.8,77.4,”Binovile”,79,81,”Square”,84,96,”Triundecile”,97.85,98.5,”Quintaseminovile”,99.6,100.0,”Biseptile”,102,103.8,”Septaquartisextile”,104.5,105.5,“Tridecile”,107.4,108.6

385DATA”Quintaquartisquare”,111.7,113.3,”Trine”,115.5,124.5,”Quintasemiseptile”,128.3,128.9,”Quadraundecile”,130.55,131.25,”Sesquiquadrate”,132.8,137.2,”Septaseminovile”,139.6,140.4

390DATA”Biquintile”,142.2,145.8,”Quincunx”,148.5,151.5,”Triseptile”,153.4,155.2,”Septaquartisquare”,156.7,158.3,“Quadrinovile”,159,161,”Quintaundecile”,163.3,164,”Undecaquartisextile”,164.5,165.5,”Opposition”,171,180

400DATA”Sun”,”Moon”,”Mercury”,”Venus”,”Mars”,”Jupiter”,”Saturn”,”Uranus”,”Neptune”,”Pluto”,”Ceres”,”Ascendant”,”Midheaven”,”North Node”

410DATA1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,13,1,14,2,3,2,4,2,5,2,6,2,7,2,8,2,9,2,10,2,11,2,12,2,13,2,14,3,4,3,5,3,6,3,7,3,8,3,9,3,10,3,11,3,12,3,13,3,14,4,5,4,6,4,7,4,8,4,9,4,10,4,11,4,12,4,13,4,14,5,6,5,7,5,8,5,9,5,10,5,11

420DATA5,12,5,13,5,14,6,7,6,8,6,9,6,10,6,11,6,12,6,13,6,14,7,8,7,9,7,10,7,11,7,12,7,13,7,14,8,9,8,10,8,11,8,12,8,13,8,14,9,10,9,11,9,12,9,13,9,14,10,11,10,12,10,13,10,14,11,12,11,13,11,14,12,14,13,14

Original programming copyright Philip Graves (2002; 2019); adaptation and further distribution welcome, on condition of acknowledging original programming authorship in any such event.

 

Part Two: Release notes and how the program works

Release Notes

  • Program written in 2002 on the Acorn BBC microcomputer
  • Transcript first published to MSN Groups in 2002
  • Transcript republished on Facebook, 10 February 2011
  • Transcription errors corrected; decimal point display limiter added; aspect names selectively updated; bug preventing some 0.0º orb oppositions from displaying in results eliminated; and program upgraded to include the Ascendant, the Midheaven and Ceres, and to increase the sensitivity to minor aspects down to those with an orb of at least 0.3º, 23 March 2019

How the Program Works

I wrote this program in about 24 hours early in 2002 on an Acorn BBC Model B+ microcomputer after being dissatisfied with the limited flexibility of the software offered freely on the Internet when it came to user-determination of aspects and their orbs. I have never purchased astrology software, and imagine it is possible that bought software allows more user control of these things. But this was for free, and anyone who knows BASIC should find it very easy to adapt according to personal preferences for orb calculation.

There are plenty of BBC emulators around on the Internet, including the free BeebEm emulator for PC, on which I’ve tested this program as recently as 2019. I don’t know which the best emulator is, and the downloading and installing process is not always easy in my experience, but for anyone game, it’s worth a try. Or you can adapt it to other platforms that run BASIC programs with a little thought, if you understand the language.

I’d be happy to explain the function of each instruction and parameter to anyone who needs help with this, although after so many years I need a little time to reflect and refamiliarise myself with what the variables and routines are doing!

Where I have shown an underscore, please do not type an underscore; instead type a space using the space bar! For most purposes, spaces are not required in BBC BASIC, and just take up memory. But in some cases they are.

Please note that at the time I wrote this program I was looking at aspects in a very modern way, based on harmonic theory, thus allowing for very minor aspects, some of which I could not determine the standard names for, with the result that I had made up my own working names that described as clearly as possible their essential derivation.

Once the functions of the various parameters and data in this program are properly understood, it is very easy to customise it. I would be more than happy to discuss this with anyone sufficiently interested to ask. For example, one could easily increase the number of points considered from 14 to 22 just by altering a few lines in the program and a few lines of data. Thus we could additionally consider aspects to Juno, Vesta, Pallas, Hygiea, the Vertex, Black Moon Lilith, Chiron, and Eris, if desired.

In operation, the program allows for the degrees of longitude at which each planet is situated to be expressed to the nearest decimal point, and you should input the positions of the factors in the chart you are looking at to the nearest whole decimal point accordingly. It does not convert from minutes of degrees to decimal points of degrees, so you have to do this yourself, but this is easy enough. The range of allowable orb for each aspect can be (and has been) customised to the nearest decimal point of a degree according to taste (in a few cases of very minor aspects, to the nearest twentieth of a degree).

When you run the program, it asks you for the sign and degree of sign at which each planet in turn is situated. Then it converts this data into the absolute degree data needed for calculation purposes. It performs its calculations then lists all the aspects found between the planets and the closeness to exactness of each aspect to the nearest decimal point of a degree (the 90 variables O in the program represent the orb in the case of every possible planetary combination, although in practice only some of the 90 are calculated each time you run the program: those needed where the planets in question have already been discovered to be in some kind of mutual aspect according to the ranges of degrees so qualifying according to the data).

Lines 50-70 in the program show how the exact number of degrees (E) involved in each of the 38 aspect types that have been programmed into the data is calculated (for the conjunction and opposition, it is merely declared, in lines 50 and 60 respectively; for the rest, it is calculated by the routine in line 70 from the minimum and maximum positions specified in the program data for the aspect type in question). From the E for each aspect type is determined the orb from exactness of each actually occurring aspect by the simple routine in lines 250 and 260.

NB: In Line 120, UN. is the standard abbreviation in BBC BASIC input method for the instruction UNTIL; and LE. is the standard abbreviation in BBC BASIC input method for the instruction LEFT$( – including the opening parenthesis.

The use of the abbreviated input method for the instructions UNTIL and LEFT$ is essential in order to complete this line within the available space allowed for inputting lines. A quirk of BBC BASIC is that you are allowed to type in lines as long as would fit in a certain number of lines on the screen. Thus, if you do not use the most economical input method, you sometimes cannot input the whole line you had in mind at all – and this is a case in point in practice! Once you have successfully input the line, the BBC computer will expand the abbreviated instructions on screen at the time of listing the program, displaying them instead as their complete forms. In other words, the numbered lines of your program are allowed to be longer than the number of screen-lines you are limited to at the input stage once that stage is complete!

Share to:

3 Comments

  1. (FreeBasic Compiler and FBIde – https://freebasic.net)

    In FreeBasic your program will look like this:

    #lang “qb”
    rem lang “QuickBasic” allows sufixes ($,%) in the variables name

    data “ARIES”,”TAURUS”,”GEMINI”,”CANCER”,”LEO”,”VIRGO”,”LIBRA”,”SCORPIO”,”SAGITTARIUS”,”CAPRICORN”,”AQUARIUS”,”PISCES”

    dim A$(12)
    rem dim sign_name(12) as string

    for i%=1 to 12
    rem for i as integer=1 to 12
    read A$(i%)
    next i%

    rem const as single orb1=9, orb2=9, orb3=4.5, orb4=6, orb5=1.8, orb6=3, orb7=0.9, orb8=1.5, orb9=1, orb10=0.6, orb11=0.35, orb12=1.5, orb13=0.2, orb14=0.3, orb15=0.2, orb16=0.8, orb18=0.4, orb20=0.2, orb24=0.5
    rem data “Quartisextile”, 360/24-orb24, 360/24+orb24
    rem data “Triquartisquare”, 3*(360/16)-orb16, 3*(360/16)+orb16

    data “Conjunct”,0,9
    data “Quartisextile”,14.5,15.5
    data “Vigintile”,17.8,18.2
    data “Seminovile”,19.6,20.4
    data “Quartisquare”,21.7,23.3
    data “Quindecile”,23.80,24.2
    data “Semiseptile”,25.4,26.0
    data “Tredecile”,27.5,27.9
    data “Semisextile”,28.5,31.5
    data “Undecile”,32.4,33.1
    data “Decile”,35.4,36.6
    data “Novile”,39,41
    data “Semisquare”,42.8,47.2
    data “Septile”,50.5,52.3
    data “Trivigintile”,53.8,54.2
    data “Bitredecile”,55.2,55.6
    data “Sextile”,57,63
    data “Biundecile”,65.1,65.8
    data “Triquartisquare”,66.7,68.3
    data “Quintile”,70.2,73.8
    data “Trisemiseptile”,76.8,77.4
    data “Quintaquartisextile”,74.5,75.5
    data “Binovile”,79,81
    data “Tritredecile”,82.9,83.3
    data “Square”,84,96
    data “Quadraquindecile”,95.8,96.2
    data “Triundecile”,97.85,98.55
    data “Quintaseminovile”,99.6,100.4
    data “Biseptile”,102,103.8
    data “Septaquartisextile”,104.5,105.5
    data “Tridecile”,107.4,108.6
    data “Quadratredecile”,110.55,110.95
    data “Quintaquartisquare”,111.7,113.3
    data “Trine”,115.5,124.5
    data “Septavigintile”,125.8,126.2
    data “Quintasemiseptile”,128.3,128.9
    data “Quadraundecile”,130.55,131.25
    data “Sesquicuadrate”,132.8,137.2
    data “Quintatredecile”,138.25,138.65
    data “Septaseminovile”,139.6,140.4
    data “Biquintile”,142.2,145.8
    data “Quincunx”,148.5,151.5
    data “Triseptile”,153.4,155.2
    data “Septaquartisquare”,156.7,158.3
    data “Quadranovile”,159,161
    data “Nonavigintile”,161.8,162.2
    data “Undecaquartisextile”,164.5,165.5
    data “Sextatredecile”,165.95,166.15
    data “Septaquindecile”,167.8,168.2
    data “Opposition”,171,180

    rem const as integer total_number_of_aspects=50
    dim B$(50)
    rem dim aspect_name(total_number_of_aspects) as string
    dim B(50),C(50),E(50) as double
    rem dim as double orb_low(total_number_of_aspects), orb_high(total_number_of_aspects), aspect_angle(total_number_of_aspects)

    for i%=1 to 50
    read B$(i%),B(i%),C(i%)
    select case i%
    case 1
    E(i%)=0
    case 2 to 50-1
    E(i%)=(B(i%)+((C(i%)-B(i%))/2))
    case 50
    E(i%)=180
    end select
    next i%

    data “Sun”,”Moon”,”Mercury”,”Venus”,”Mars”,”Jupiter”,”Saturn”,”Uranus”,”Neptune”,”Pluto”,”North Node”

    dim P$(11)
    rem const as integer total_number_of_planets=11
    rem dim planet_name(total_number_of_planets) as string

    for i%=1 to 11
    read P$(i%)
    next i%

    dim D(11) as double
    rem dim degree(total_number_of_planets) as double

    rem S$
    rem dim s as string

    rem M
    rem dim min as integer

    rem S%
    rem dim sign_number as integer

    for i%=1 to 11
    print
    do
    print “Please enter “;P$(i%);” sign”;:input S$

    S%=0

    select case ucase$(left$(S$,2))
    case left$(A$(1),2)
    S%=1
    case left$(A$(2),2)
    S%=2
    case left$(A$(3),2)
    S%=3
    case left$(A$(5),2)
    S%=5
    case left$(A$(6),2)
    S%=6
    case left$(A$(7),2)
    S%=7
    case left$(A$(8),2)
    S%=8
    case left$(A$(9),2)
    S%=9
    case left$(A$(11),2)
    S%=11
    case left$(A$(12),2)
    S%=12
    end select

    select case ucase$(left$(S$,3))
    case left$(A$(4),3)
    S%=4
    case left$(A$(10),3)
    S%=10
    end select

    rem for j%=1 to 12
    rem if j%=4 or j%=10 then
    rem rem ucase converts to uppercase letter
    rem if ucase$(left$(S$,3))=left$(A$(j%),3) then
    rem S%=j%
    rem rem go to the next line after “next j”
    rem exit for
    rem end if
    rem else
    rem if ucase$(left$(S$,2))=left$(A$(j%),2) then
    rem S%=j%
    rem exit for
    rem end if
    rem end if
    rem next j%

    loop until S%0

    do
    print “Please enter “;P$(i%);” degree”;:input D(i%)
    loop until D(i%)>=0 and D(i%)=0 and M<=59

    D(i%)=D(i%)+M/60+(S%-1)*30
    next i%

    rem n$="Windows_real_users_name"
    rem dim as string users_name="Windows_real_users_name"

    rem f$="real_file_name"
    rem dim as string file_name="real_file_name"

    rem open "C:\Users\"+n$+"\Documents\"+f$+".txt" for output as #1
    rem open "C:\Users\"+users_name+"\Documents\"+file_name+".txt" for output as #1

    rem replace all <> with <>
    rem replace all <> with <>
    rem delete H% and “Hit any key to continue/end.”

    cls

    dim T,O as double
    rem dim as double planets_angle, orb

    H%=0
    rem dim as integer line_index=0

    for i%=1 to 11-1
    for k%=(i%+1) to 11
    T = abs(D(i%) – D(k%))
    if T > 180 then
    T = 360 – T
    end if
    for j%=1 to 50
    if T>B(j%) and T<C(j%) then
    O=abs(T-E(j%))
    H%=H%+1
    print P$(i%);" ";B$(j%);" ";P$(k%);" ";:print using "#'##";fix(O);fix((O-fix(O))*60)
    if H%=20 then
    H%=0
    print "Hit any key to continue.":sleep
    cls
    end if
    exit for
    end if
    next j%
    next k%
    next i%

    rem close #1

    print:print "Hit any key to end.":sleep

  2. When publishing the comment, some symbols have been lost or converted. In order for the program to work, the following changes must be made:

    Replace the inverted quotes to the left and right ” by the vertical quotes (shift + “2” key).

    Replacing long dashes – by short dashes (subtract key “-“).

    In the line: loop until S%0, add the symbol v rotated 90 degrees to the right and the symbol v rotated 90 degrees to the left, between % and 0.

    The tabulations have also been lost, but that does not affect the program.

  3. Also, in the line: loop until D (i%)> = 0 and D (i%) = 0 and M <= 59 some text is missing:

    Just after the second closing parenthesis, insert the following text:

    the symbol v rotated 90 degrees to the right, and the following text, followed by the symbol v rotated 90 degrees to the left at the end:

    = 29 do print "Please enter"; P $ (i%); "minute";: input M loop until M

Leave a Reply

Your email address will not be published.


*