END IF\r
END SUB\r
\r
-\r
-SUB RotatePoint (centerX, centerY, pointX, pointY, angleRadians)\r
+SUB RotatePoint (rotationCenterX, rotationCenterY, pointToRotateX, pointToRotateY, rotationAngle)\r
'\r
-' Rotates point (pointX, pointY) around (centerX, centerY) by angleRadians.\r
-' Standard 2D rotation formula:\r
-' X' = (X - CX)*cos - (Y - CY)*sin + CX\r
-' Y' = (X - CX)*sin + (Y - CY)*cos + CY\r
+' Rotates a 2D point around a center using standard rotation formulas.\r
+' X' = (X - CX)*cos - (Y - CY)*sin + CX\r
+' Y' = (X - CX)*sin + (Y - CY)*cos + CY\r
'\r
- deltaX = pointX - centerX\r
- deltaY = pointY - centerY\r
- sinAngle = SIN(angleRadians)\r
- cosAngle = COS(angleRadians)\r
- pointX = deltaX * cosAngle - deltaY * sinAngle + centerX\r
- pointY = deltaX * sinAngle + deltaY * cosAngle + centerY\r
+ deltaX = pointToRotateX - rotationCenterX\r
+ deltaY = pointToRotateY - rotationCenterY\r
+ sinAngle = SIN(rotationAngle)\r
+ cosAngle = COS(rotationAngle)\r
+ pointToRotateX = deltaX * cosAngle - deltaY * sinAngle + rotationCenterX\r
+ pointToRotateY = deltaX * sinAngle + deltaY * cosAngle + rotationCenterY\r
END SUB\r
\r
-\r
-'-------------------------------------------------------------------------------\r
SUB Scene1\r
'\r
' Loads & processes 3D data from "data.dat" to demonstrate simple line rendering.\r