functions.bmx 879 B

123456789101112131415161718192021222324252627282930
  1. 'This BMX file was edited with BLIde ( http://www.blide.org )
  2. 'Private
  3. Function GetRotationCords:TDrawingPoint(Angle:Float, Source:TDrawingPoint, Center:TDrawingPoint)
  4. ?Not debug
  5. If angle >= - 0.01 And angle <= 0.01 Then 'Little optimization for release mode
  6. Return CreateDrawingPoint(source.X, source.Y)
  7. End If
  8. ?
  9. Local Radius:Double = ((source.X - center.x) ^ 2 + (source.Y - center.Y) ^ 2) ^ 0.5
  10. Local NewX:Double = Double(Center.X) + Double(radius) * Cos(angle)
  11. Local NewY:Double = Double(Center.Y) + Double(radius) * Sin(angle)
  12. Return CreateDrawingPoint(Float(newx), Float(newy))
  13. End Function
  14. Function DPrints(T:String)
  15. ?debug
  16. Print t
  17. ?
  18. End Function
  19. Rem
  20. bbdoc: This function rounds properly a decimal value.
  21. end rem
  22. Function FM_Round:Int(number:Double)
  23. Return Int(number + 0.5:Double * Sgn(number))
  24. End Function
  25. 'Public