PureBasic:Math
PureBasic:Manuel
<< Précédent | Sommaire | Suivant >>
[modifier] General
La librairie Math propose des fonctions arithémtiques telles que Cos(), Sin(), Pow(), Log() etc... La plupart des commandes fonctionnent avec des nombres flottants (.f).
[modifier] Sommaire des commandes
Exemple
;
; ------------------------------------------------------------
;
; PureBasic - Math example file
;
; (c) 2003 - Fantaisie Software
;
; ------------------------------------------------------------
;
Procedure DrawCircle(Parameter)
Repeat
X.f = Random(80)
Y.f = X
If StartDrawing(WindowOutput())
FrontColor(Random(255), Random(255), Random(255))
For k=0 To 630
a.f+0.01
x2.f = X*Cos(a) + Y*Sin(a)
y2.f = X*Sin(a) - Y*Cos(a)
Plot(200+x2, 200+y2)
Plot(100+x2, 200+y2)
Delay(10)
Next
StopDrawing()
EndIf
ForEver
EndProcedure
If OpenWindow(0, 200, 200, 400, 400, #PB_Window_SystemMenu, "Test")
CreateThread(@DrawCircle(), 0)
Repeat
Until WaitWindowEvent() = #PB_EventCloseWindow
EndIf
[modifier] OS supportés
Windows, Linux, MacOS X, MacOS X

