J
jason
I've seen some code in word for creating a spiral of stars on a
document.
I'm trying to adapt this to Excel.So far I have this:-
Const pi = 3.1416
Dim t As Single
Dim i As Integer
Dim z As Single
Dim x As Single, y As Single
Dim n As Single 'number of stars per cycle
Dim k As Single 'length of spiral
Dim sSize As Single 'star size
Dim sh As Shape
Sub DrawSpiral()
n = 80
k = 80000
sSize = 6
For i = 5 To n
t = k * pi * i / n
x = 2 * (1 / t) * Sin(t) * 100000000
y = 2 * (1 / t) * Cos(t) * 1000000
Set sh = ActiveSheet.Shapes.AddShape(msoShape5pointStar, x, y,
sSize, sSize)
Next i
End Sub
Unfortunately it just creates a shower of stars.Not altogether
unattractive!but not what I'm after.One of the problems I think is
that there seems to be an extra argument for the addshape method in
word - a fifth argument which specifies a starting point.
Are there any mathematicians out there who can help??
J
document.
I'm trying to adapt this to Excel.So far I have this:-
Const pi = 3.1416
Dim t As Single
Dim i As Integer
Dim z As Single
Dim x As Single, y As Single
Dim n As Single 'number of stars per cycle
Dim k As Single 'length of spiral
Dim sSize As Single 'star size
Dim sh As Shape
Sub DrawSpiral()
n = 80
k = 80000
sSize = 6
For i = 5 To n
t = k * pi * i / n
x = 2 * (1 / t) * Sin(t) * 100000000
y = 2 * (1 / t) * Cos(t) * 1000000
Set sh = ActiveSheet.Shapes.AddShape(msoShape5pointStar, x, y,
sSize, sSize)
Next i
End Sub
Unfortunately it just creates a shower of stars.Not altogether
unattractive!but not what I'm after.One of the problems I think is
that there seems to be an extra argument for the addshape method in
word - a fifth argument which specifies a starting point.
Are there any mathematicians out there who can help??
J