Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Java: Общие вопросы > Кривизна линий в 2D


Автор: oson 25.4.2010, 17:17
В .Net есть такой метод
Код

public void DrawCurve(System.Drawing.Pen pen, System.Drawing.PointF[] points, float tension)

где tension - это некий параметр изогнутости.



В Java есть похожий метод 
Код

CubicCurve2D.Double(double x1, double y1,double ctrlx1, double ctrly1,
              double ctrlx2, double ctrly2, double x2, double y2)

где
x1 - the X coordinate for the start point of the resulting CubicCurve2D
y1 - the Y coordinate for the start point of the resulting CubicCurve2D
ctrlx1 - the X coordinate for the first control point of the resulting CubicCurve2D
ctrly1 - the Y coordinate for the first control point of the resulting CubicCurve2D
ctrlx2 - the X coordinate for the second control point of the resulting CubicCurve2D
ctrly2 - the Y coordinate for the second control point of the resulting CubicCurve2D
x2 - the X coordinate for the end point of the resulting CubicCurve2D
y2 - the Y coordinate for the end point of the resulting CubicCurve2D

Вопрос - есть какой-то метод в Java аналогичный DrawCurve из .Net с параметром изогнутости типа 
tension?
Если нет, то как реализовать этот параметр при помощи control point в Java методе?
Как они соотносятся: тот - угол, а эти - точки, к которым направлена касательная.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)