# Rose curve

Polar equation of the form R = a Cos nƟ and R = a Sin nƟ are called petal Rose curves. The variable a determines the length of the petals. n determines the number of petals. If n is odd there are n petals. If n is even there are 2n petals.

The template for drawing the polar equations for Cos and Sin only varies on one line (plus obtaining the input from the form). The Sin version is shown here.

```
Sub sin_petal()
'R = B * Sin(C * A) + D
Call init_polar
Dim B As Double, C As Double, D As Double
B = frm_polar.txt_b1.Value
C = frm_polar.txt_c1.Value
D = frm_polar.txt_d1.Value

Dim R As Double, A As Integer
Dim X As Double, Y As Double
Dim i As Integer, numpts As Integer
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)

'this is the function
R = B * Sin(C * A_rad) + D

pt(i * 2 - 1) = X: pt(i * 2) = Y
Next i

Update
strLabel = "R= " & B & "* Sin " & C & "A + " & D
Call label_graph
End Sub

Public Const pi As Double = 3.14159265359

Function deg2rad(deg As Integer) As Double
deg2rad = deg * pi / 180
End Function

```