Private Const degtorad = 0.017453292
Private Const PI = 3.141592654
Sub parabola()
Dim x As Double, y As Double
Dim diameter As Double
diameter = 3
Dim a As Double 'focal point height
a = 0.4
Dim radius As Double
radius = diameter * 0.5
Dim grs As Graphics
Dim gr1 As Graphic
Set grs = ActiveDrawing.Graphics
Set gr1 = grs.Add(, "polyline")
x = -radius
For t = -100 To 100
x = x + radius / 100
y = a * x ^ 2
Set ver = gr1.Vertices.Add(x, y, 0)
Set ver = Nothing
Next t
'ActiveDrawing.Graphics.AddLineSingle -diameter * 0.5, 0, 0, diameter * 0.5, 0, 0
ActiveDrawing.Graphics.AddLineSingle 0, -a, 0, 0, y, 0
ActiveDrawing.Graphics.AddLineSingle -diameter * 0.5, a, 0, diameter * 0.5, a, 0
ActiveDrawing.Graphics.AddText "F", 0, a, 0, a
ActiveDrawing.Graphics.AddLineSingle -diameter * 0.5, -a, 0, diameter * 0.5, -a, 0
ActiveDrawing.Graphics.AddText "directrix", 0, -a, 0, a
Set gr1 = Nothing
ActiveDrawing.ActiveView.ZoomToExtents
End Sub
Sub paraboloid()
Dim x As Double, y As Double, thick As Double
Dim grs As Graphics
Dim gr As Graphic
Dim gr1 As Graphic
Set grs = ActiveDrawing.Graphics
Set gr1 = grs.Add(, "polyline")
Set gr = grs.Add(, "TCW40SPIN") '
gr.Properties("$ROTATIONANGLE") = 360 'deg
'axis of rotation
Set ver = gr.Vertices.Add(0, 0, 0)
Set ver = Nothing
Set ver = gr.Vertices.Add(0, 100, 0)
Set ver = Nothing
Dim diameter As Double
diameter = 3
Dim a As Double 'focal point height
a = 0.4
Dim radius As Double
radius = diameter * 0.5
x = 0
For t = 0 To 51
y = a * x ^ 2
Set ver = gr1.Vertices.Add(x, y, 0)
Set ver = Nothing
x = x + radius / 50
Next t
thick = 0.05
For t = 51 To 0 Step -1
x = x - radius / 50
y = a * x ^ 2
theta = 2 * a * x
xp = x + thick * Sin(theta)
yp = y - thick * Cos(theta)
If xp <= 0 Then
Exit For
End If
Set ver = gr1.Vertices.Add(xp, yp, 0)
Set ver = Nothing
Next t
Set ver = gr1.Vertices.AddClose
Set ver = Nothing
Set gr1 = grs.Remove(gr1.Index)
gr.Graphics.AddGraphic gr1
Set gr1 = Nothing
Set gr = Nothing
ActiveDrawing.ActiveView.ZoomToExtents
End Sub