I put this together in just 1 1/2 hours tonight without knowing any equations, just some knowledge about the Circle command's radians that I've used before. This doesn't make circles, except for the line it makes using circles. What it does is make a graph of the degrees you punch in. For example, if you punch in 90, it will make a thick line going straight up. If you punch in 180 it will make a thick line going to the left, and so on. It also writes out the degrees next to the line. Plus I added printer support so you can print out the picture if you wish to on your printer. When it uses the printer, I made it so the background is white and the graphics are black and the thick line is blue. I've wanted to make this since I started programming in BASIC in the 1980's. Amazing I figured it out all by myself this time. Feel free to use any of this in your own code of course. I might try some artwork with it sometime. Everything in the app is self-explanatory. Enjoy.
picture sharing
picture sharing
Code: (Select All)
'Degrees Graph Plotter by SierraKen
'Made on July 11, 2022
Screen _NewImage(800, 800, 32)
Dim img As Long
start:
_Title "Degrees Graph Plotter by SierraKen"
Cls
Print "Degrees Graph Plotter"
Print: Print
Print "By SierraKen"
Print: Print: Print
Print "This app will plot a graph from the degrees you give it."
Print "It can also print it on a printer by pressing P."
Print "To do another one, just press the Space Bar."
Print "To quit, press the Esc key."
Print: Print: Print: Print
Input "Type Degrees Here: ", deg
start2:
Color _RGB32(255, 255, 255), _RGB32(0, 0, 0)
Cls
'Vertical and Horizontal dashes.
For vert = 0 To 780 Step 20
Line (400, vert)-(400, vert + 10), _RGB32(255, 255, 255)
Next vert
For horiz = 0 To 800 Step 20
Line (horiz, 400)-(horiz + 10, 400), _RGB32(255, 255, 255)
Next horiz
'Add 90 degrees to your amount for degrees to radians below.
deg = 90 + deg
'Plot 300 points with equations.
For t = 0 To 300
x = (Sin(_D2R(deg)) * t) + 400
y = (Cos(_D2R(deg)) * t) + 400
Circle (x, y), 2, _RGB32(0, 255, 0)
Next t
deg$ = Str$(deg - 90) + " Degrees"
_PrintString (x + 10, y + 20), deg$
'Wait to see if you want more.
_Title "Press P to Print on Paper, Space Bar for another Degree, or Esc to Quit,"
Do
a$ = InKey$
If a$ = Chr$(27) Then End
If a$ = " " Then GoTo start:
'Printing on the Printer
If a$ = "p" Or a$ = "P" Then
If img& <> 0 Then _FreeImage (img&)
Cls
Paint (0, 0), _RGB32(255, 255, 255)
'Vertical and Horizontal dashes.
For vert = 0 To 780 Step 20
Line (400, vert)-(400, vert + 10), _RGB32(0, 0, 0)
Next vert
For horiz = 0 To 800 Step 20
Line (horiz, 400)-(horiz + 10, 400), _RGB32(0, 0, 0)
Next horiz
'Plot 300 points with equations.
For t = 0 To 300
x = (Sin(_D2R(deg)) * t) + 400
y = (Cos(_D2R(deg)) * t) + 400
Circle (x, y), 2, _RGB32(0, 0, 255)
Next t
Color _RGB32(0, 0, 0), _RGB32(255, 255, 255)
deg$ = Str$(deg - 90) + " Degrees"
_PrintString (x + 10, y + 20), deg$
img& = _CopyImage(0)
_PrintImage img&
_Delay 5
deg = deg - 90
GoTo start2:
End If
Loop
GoTo start: