Hello

        I am trying to draw an equiangular spiral :

Sub DrawEquiangularSpiral
Dim Doc As Object
Dim Page As Object
Dim LineShape As Object
Dim Point As New com.sun.star.awt.Point
Dim LastPoint As New com.sun.star.awt.Point
Dim Size As New com.sun.star.awt.Size
Dim R0 As Long
Dim NumTurns As Integer
Dim AngleMin As Long
Dim AngleStep As Long
Dim AngleMax As Long
Dim CurrentAngle As Long
Dim InitialX As Long
Dim InitialY As Long
Dim ExponentialCoefficient As Long
Dim SpiralThickness As Long
Dim I As Integer
Dim CurrentLocation As Long

Doc=ThisComponent
Page=Doc.drawPages(0)

Page.Width=20000
Page.Height=20000
InitialX=Page.Width/2
InitialY=Page.Height/2
LastPoint.x=InitialX
LastPoint.y=InitialY

SpiralThickness=35

R0=100
ExponentialCoefficient=0.1

NumTurns=10
AngleMin=0
AngleMax=36000
AngleStep=50

For I = 1 To NumTurns
        For CurrentAngle = I*AngleMax+AngleMin To I*AngleMax+AngleMax Step
AngleStep
                CurrentLocation=R0*Exp(ExponentialCoefficient*CurrentAngle/100)
                Point.x=LastPoint.x+CurrentLocation*Cos(CurrentAngle)
                Point.y=LastPoint.y+CurrentLocation*Sin(CurrentAngle)
                LineShape = Doc.createInstance("com.sun.star.drawing.LineShape")
                LineShape.LineStart=LastPoint
                LineShape.LineEnd=Point
                LineShape.LineWidth=SpiralWidth
        
                LineShape.LineColor = RGB(0,0,0)
                Page.add(LineShape)
                LastPoint.x=Point.x
                LastPoint.y=Point.y
        Next CurrentAngle
Next I

End Sub

        This just draws a bunch of coincident lines in the top left corner of 
the
page (not even the right starting point), which tells me that it is not
honoring the LineStart and LineEnd assignments.

        What am I missing ?

Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to