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











































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



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:


  1. (FreeBasic Compiler and FBIde –

    In FreeBasic your program will look like this:

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


    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
    case 2 to 50-1
    case 50
    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 “Please enter “;P$(i%);” sign”;:input S$


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

    select case ucase$(left$(S$,3))
    case left$(A$(4),3)
    case left$(A$(10),3)
    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

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

    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.”


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

    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
    print P$(i%);" ";B$(j%);" ";P$(k%);" ";:print using "#'##";fix(O);fix((O-fix(O))*60)
    if H%=20 then
    print "Hit any key to continue.":sleep
    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.