As a brief example, the Function "UpdateVector" here seems unnecessarily complex when all that's required would be a modification to the existing components...

`SuperStrict`

Const oX:Int = 512

Const oY:Int = 384

Global Vector:SVec2D

Global ChosenVector:Byte=False

RunTime()

Function GetVector()

While (Not(ChosenVector))

draw

If (WaitMouse()=1)

Vector = New SVec2D(MouseX()-oX, MouseY()-oY)

DebugLog(Vector[0]+","+Vector[1])

ChosenVector=1

End If

Wend

End Function

Function RunTime()

Graphics(oX * 2, oY * 2)

FlushMouse()

SetOrigin oX,oY

GetVector

While Not (KeyHit(KEY_ESCAPE))

updatevector

draw

Wend

EndGraphics

End

End Function

Function Draw()

Cls

DrawVector

DrawGrid

Flip

End Function

Function DrawVector()

SetColor(255,0,0)

DrawLine 0,0,Vector[0],Vector[1]

End Function

Function UpdateVector()

Local dX:Double = Sin(270 - (MilliSecs() / 1000)) * Vector.Length()

Local dY:Double = Cos(270 - (MilliSecs() / 1000)) * Vector.Length()

Vector = Null

GCCollect

Vector = New SVec2D(dX,dY)

DebugLog(Vector[0]+","+Vector[1])

End Function

Function DrawGrid()

SetColor(192,192,192)

DrawLine -oX,0,ox,0

DrawLine 0,-oY,0,oY

End Function