Archimedes’ spiral : R = kA

the program is the same we have been using.

Sub arch_spiral()
'R = BA
Call init_polar
Dim B As Double
B = frm_polar.txt_b3.Value
Dim R As Double, A As Integer
Dim X As Double, Y As Double
Dim A_rad As Double
Dim i As Integer, numpts As Integer
Dim plineobj As AcadLWPolyline
Dim pt() As Double
numpts = (Amax - Amin) / A_inc 'num of lines
numpts = numpts + 1
ReDim pt(1 To numpts * 2)
For i = 1 To numpts
A = Amin + ((i - 1) * A_inc)
A_rad = deg2rad(A)
'this is the function
R = B * A_rad
X = R * Cos(A_rad)
Y = R * Sin(A_rad)
pt(i * 2 - 1) = X: pt(i * 2) = Y
Next i
Set plineobj = acadDoc.ModelSpace.AddLightWeightPolyline(pt)
Update
strLabel = "R= " & B & " * A"
Call label_graph
End Sub

### Like this:

Like Loading...

*Related*