Post Reply 
(50g) Coordinate Rotation
02-21-2015, 02:48 PM
Post: #1
(50g) Coordinate Rotation
CRDTRN calculates the rotation of a single point (x0, y0) given center (xc, yc) and angle θ. Good for a subroutine.

Code:
<< → XOLD YOLD XCTR YCTR θ
<< XOLD YOLD R→C XCTR YCTR R→C – θ DUP COS →NUM SWAP NEG SIN →NUM R→C * >> >>

Input:
5: x0
4: y0
3: xc
2: yc
1: θ

Example:
Original Point: (10, 10) with new center (1,1) and rotation angle 0.5 radian

Result: (12.2130729044, 3.58341320957)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)