
also, wenn du so ne proc schreiben magst, kannste gerne machen,
und ich freu mich, wenn sie ne struct zur rückgabe benutzt,
und dann darfst du sie auch gleich nochmal stolz im CT&T posten...

Ich 'abe fertig!STARGÅTE hat geschrieben:sry das ich jetzt dazwischen frage :
Wo genau seit ihr jetzt ^^ ?
...aber nur, wenn er ein Strontium-Atom damit darstelltKaeru Gaman hat geschrieben:und dann darfst du sie auch gleich nochmal stolz im CT&T posten...
Code: Alles auswählen
Procedure EllipseAngle(x, y, RadiusX, RadiusY, Angle.f=0, Farbe=-1)
Protected x1.l, y1.l, x2.l, y2.l, dx.f, dy,f, j.f
Angle = Angle * #PI/180
x1 = x + Cos(Angle)*RadiusX - Sin(Angle)*RadiusY
y1 = y + Sin(Angle)*RadiusX + Cos(Angle)*RadiusY
For n = 5 To 360 Step 5
j = n * #PI/180
dx = Cos(j)*RadiusX - Sin(j)*RadiusX
dy = Sin(j)*RadiusY + Cos(j)*RadiusY
x2 = x + Cos(Angle)*dx - Sin(Angle)*dy
y2 = y + Sin(Angle)*dx + Cos(Angle)*dy
If Farbe = -1
LineXY(x1, y1, x2, y2)
Else
LineXY(x1, y1, x2, y2, Farbe)
EndIf
x1 = x2
y1 = y2
Next n
EndProcedure
Structure Punkt2D
x.d
y.d
EndStructure
Procedure EllipseAnglePoint(RadiusX.d, RadiusY.d, EllipseAngle.d, PositionAngle.d, *Point.Punkt2D)
Protected x.d, y.d, dx.d, dy.d
EllipseAngle = EllipseAngle * #PI/180
PositionAngle = PositionAngle * #PI/180
dx = Cos(PositionAngle)*RadiusX - Sin(PositionAngle)*RadiusX
dy = Sin(PositionAngle)*RadiusY + Cos(PositionAngle)*RadiusY
*Point\x = Cos(EllipseAngle)*dx - Sin(EllipseAngle)*dy
*Point\y = Sin(EllipseAngle)*dx + Cos(EllipseAngle)*dy
EndProcedure
OpenWindow(0, 0, 0, 800, 600, "E", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
Repeat
If WindowEvent() = #PB_Event_CloseWindow : End : EndIf
Delay(10)
Angle+1
StartDrawing(WindowOutput(0))
DrawingMode(1)
Box(0,0,800,600,$000000)
EllipseAngle(400, 300, 200, 100, 40, $0000FF)
EllipseAnglePoint(200, 100, 40, Angle, Point.Punkt2D)
Circle(400+Point\x,300+Point\y,10, $FF0000)
StopDrawing()
ForEver