當前位置: 首頁>>代碼示例>>Java>>正文


Java CubicCurve2D.getY2方法代碼示例

本文整理匯總了Java中java.awt.geom.CubicCurve2D.getY2方法的典型用法代碼示例。如果您正苦於以下問題:Java CubicCurve2D.getY2方法的具體用法?Java CubicCurve2D.getY2怎麽用?Java CubicCurve2D.getY2使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.geom.CubicCurve2D的用法示例。


在下文中一共展示了CubicCurve2D.getY2方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: subdivide

import java.awt.geom.CubicCurve2D; //導入方法依賴的package包/類
private static void subdivide(CubicCurve2D src, CubicCurve2D left, CubicCurve2D right, final double coef) {
	final double coef1 = coef;
	final double coef2 = 1 - coef;
	final double centerxA = src.getCtrlX1() * coef1 + src.getCtrlX2() * coef2;
	final double centeryA = src.getCtrlY1() * coef1 + src.getCtrlY2() * coef2;

	final double x1 = src.getX1();
	final double y1 = src.getY1();
	final double x2 = src.getX2();
	final double y2 = src.getY2();
	final double ctrlx1 = x1 * coef1 + src.getCtrlX1() * coef1;
	final double ctrly1 = y1 * coef1 + src.getCtrlY1() * coef1;
	final double ctrlx2 = x2 * coef1 + src.getCtrlX2() * coef1;
	final double ctrly2 = y2 * coef1 + src.getCtrlY2() * coef1;

	final double ctrlx12 = ctrlx1 * coef1 + centerxA * coef1;
	final double ctrly12 = ctrly1 * coef1 + centeryA * coef1;
	final double ctrlx21 = ctrlx2 * coef1 + centerxA * coef1;
	final double ctrly21 = ctrly2 * coef1 + centeryA * coef1;
	final double centerxB = ctrlx12 * coef1 + ctrlx21 * coef1;
	final double centeryB = ctrly12 * coef1 + ctrly21 * coef1;
	left.setCurve(x1, y1, ctrlx1, ctrly1, ctrlx12, ctrly12, centerxB, centeryB);
	right.setCurve(centerxB, centeryB, ctrlx21, ctrly21, ctrlx2, ctrly2, x2, y2);
}
 
開發者ID:Banno,項目名稱:sbt-plantuml-plugin,代碼行數:25,代碼來源:BezierUtils.java

示例2: getMiddlePoint

import java.awt.geom.CubicCurve2D; //導入方法依賴的package包/類
/**
 * Report the half-way point on Bézier curve.
 *
 * @return the middle of the curve arc
 */
public Point2D getMiddlePoint ()
{
    CubicCurve2D c = getCurve();

    return new Point2D.Double(
            (c.getX1() + (3 * c.getCtrlX1()) + (3 * c.getCtrlX2()) + c.getX2()) / 8,
            (c.getY1() + (3 * c.getCtrlY1()) + (3 * c.getCtrlY2()) + c.getY2()) / 8);
}
 
開發者ID:Audiveris,項目名稱:audiveris,代碼行數:14,代碼來源:Circle.java

示例3: CubicFacade

import java.awt.geom.CubicCurve2D; //導入方法依賴的package包/類
public CubicFacade (CubicCurve2D curve)
{
    this.x1 = curve.getX1();
    this.y1 = curve.getY1();
    this.ctrlx1 = curve.getCtrlX1();
    this.ctrly1 = curve.getCtrlY1();
    this.ctrlx2 = curve.getCtrlX2();
    this.ctrly2 = curve.getCtrlY2();
    this.x2 = curve.getX2();
    this.y2 = curve.getY2();
}
 
開發者ID:Audiveris,項目名稱:audiveris,代碼行數:12,代碼來源:Jaxb.java

示例4: reverse

import java.awt.geom.CubicCurve2D; //導入方法依賴的package包/類
public static CubicCurve2D.Double reverse(CubicCurve2D curv) {
	return new CubicCurve2D.Double(curv.getX2(), curv.getY2(), curv.getCtrlX2(), curv.getCtrlY2(),
			curv.getCtrlX1(), curv.getCtrlY1(), curv.getX1(), curv.getY1());
}
 
開發者ID:Banno,項目名稱:sbt-plantuml-plugin,代碼行數:5,代碼來源:DotPath.java


注:本文中的java.awt.geom.CubicCurve2D.getY2方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。