개정판 e65e8c5c
Fix: 회전 로직 수정
Change-Id: I8f2e7b85a1365f06764fbd9203f29594610b14c5
MarkupToPDF/Controls/Common/MathSet.cs | ||
---|---|---|
104 | 104 |
} |
105 | 105 |
|
106 | 106 |
/// <summary> |
107 |
/// get intersection point betwwen this and line2d
|
|
107 |
/// get intersection point between this and line2d
|
|
108 | 108 |
/// </summary> |
109 | 109 |
/// <author>humkyung</author> |
110 | 110 |
/// <date>2012.08.30</date> |
... | ... | |
252 | 252 |
return ((angle * Math.PI) / 180f); |
253 | 253 |
} |
254 | 254 |
|
255 |
//public static double AngleMethod(double px1, double py1, double px2, double py2) |
|
256 |
//{ |
|
257 |
// return Math.Abs(Math.Atan2(px2 - px1, py1 - py2) * Rad2Deg); |
|
258 |
//} |
|
259 | 255 |
public static double DistanceTo(Point p1, Point p2) |
260 | 256 |
{ |
261 | 257 |
double dx = p2.X - p1.X; |
... | ... | |
336 | 332 |
/// <returns></returns> |
337 | 333 |
public static Point RotateAbout(Point org, Point dest, double dAngle) |
338 | 334 |
{ |
339 |
double ptx = dest.X - org.X; |
|
340 |
double pty = dest.Y - org.Y; |
|
341 |
double radians = Math.PI * dAngle / 180.0; |
|
342 |
double pt1x = org.X + ((Math.Cos(radians) * ptx) - (Math.Sin(radians) * pty)); |
|
343 |
double pt2x = org.Y + ((Math.Sin(radians) * ptx) + (Math.Cos(radians) * pty)); |
|
344 |
return new Point(pt1x, pt2x); |
|
335 |
var transform = new RotateTransform() { Angle = dAngle, CenterX = org.X, CenterY = org.Y }; |
|
336 |
return transform.Transform(dest); |
|
345 | 337 |
} |
346 | 338 |
|
347 | 339 |
public static double getAngle(double x1, double y1, double x2, double y2) |
내보내기 Unified diff