Question About Entity Rotate
Moderators: SDS, support, admin
Question About Entity Rotate
Dear Sir,
I draw a one-entity (rectangle) dxf file, its center point is (1000,1000) and width = 600, height = 800.
When I use the “MergeFileDemo.exe” program, I find If I rotate the entity 90 degree, the entity’s
center point will change to (-1000,1000).
Is there a formula to calculate the entity new center point if I had rotated the entity some degree (ex. 20 or 30)?
Anderson.
I draw a one-entity (rectangle) dxf file, its center point is (1000,1000) and width = 600, height = 800.
When I use the “MergeFileDemo.exe” program, I find If I rotate the entity 90 degree, the entity’s
center point will change to (-1000,1000).
Is there a formula to calculate the entity new center point if I had rotated the entity some degree (ex. 20 or 30)?
Anderson.
Re: Question About Entity Rotate
Hello,
Rotation occurs respectively to the insert point. Please take a look at the following code which is available in CADConst.cs:
Sergey.
Rotation occurs respectively to the insert point. Please take a look at the following code which is available in CADConst.cs:
Code: Select all
public struct DPoint
public static DPoint Rotate(DPoint p, double angle)
{
double s, c;
DPoint result;
angle = CADConst.Radian(angle);
s = Math.Sin(angle);
c = Math.Cos(angle);
result.X = c * p.X - s * p.Y;
result.Y = s * p.X + c * p.Y;
result.Z = p.Z;
return result;
}
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support