-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to rotate a curve ? #41
Comments
To rotate a curve You can follow these steps:
Here is a brief explanation in pseudo-code for rotating a curve around the origin by an angle
: ) Not sure is right |
Hi,
This is a generic question of how to rotate a polynomial curve. So it is actually not a SISL issue.
The curves in SISL are either B-spline curves or for those you can just rotate the points of the control polygon. For the NURBS curves you must rotate the control points projected to affine space.
For rotation of parametric curves in the power bases you probably can find algorithms in the literature.
Tor
From: ChenXing Wang ***@***.***>
Sent: Tuesday, February 20, 2024 10:59
To: SINTEF-Geometry/SISL ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [SINTEF-Geometry/SISL] How to rotate a curve ? (Issue #41)
To rotate a curve You can follow these steps:
1. Consider your curve the parabolic arc C(u) = a_{0} + a_{1}u + a_{2}u^2
2. Define the Matrix: Decide the point that you want to rotate. The point can be any point in the coordinate system.
3. Rotate the Matrix: Use a rotation matrix to perform the rotation. You can also define the angle of rotation & the axis of rotation (e.g., x-axis, y-axis, z-axis), For 2D, you use 2x2 rotation matrix, for 3D, you use 3x3 rotation matrix.
Here is a brief explanation in pseudo-code for rotating a curve around the origin by an angle theta
/* Define curve points (x, y) */
curve_points[(x0, y0), (x1, y1), (x2, y2)]
/* Define angle of rotation */
theta = x degrees
/* Define rotation matrix */
rotation_matrix = [[cos(theta), -sin(theta)],
[sin(theta), cos(theta)]]
/* Rotate each curve point */
rotated_curve = []
for x, y in curve_points:
x_new = x * cos(theta) - y * sin(theta)
y_new = x * sin(theta) + y * cos(theta)
rotated_curve.append((x_new, y_new))
: ) Not sure is right
-
Reply to this email directly, view it on GitHub<#41 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABBHBM2PI6LEZKNXR24I33LYURXWBAVCNFSM5TL7KIX2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJVGM4DKNRZGA3A>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.******@***.***>>
|
How can I rotate a curve ?
The text was updated successfully, but these errors were encountered: