本文整理汇总了Java中math.geom2d.Point2D.createPolar方法的典型用法代码示例。如果您正苦于以下问题:Java Point2D.createPolar方法的具体用法?Java Point2D.createPolar怎么用?Java Point2D.createPolar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类math.geom2d.Point2D
的用法示例。
在下文中一共展示了Point2D.createPolar方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transformPoint
import math.geom2d.Point2D; //导入方法依赖的package包/类
public Point2D transformPoint(java.awt.geom.Point2D pt) {
Point2D center = circle.getCenter();
double r = circle.getRadius();
double d = r*r/Point2D.getDistance(pt, center);
double theta = Angle2D.getHorizontalAngle(center, pt);
return Point2D.createPolar(center, d, theta);
}
示例2: transform
import math.geom2d.Point2D; //导入方法依赖的package包/类
public Point2D transform(java.awt.geom.Point2D pt) {
Point2D center = circle.getCenter();
double r = circle.getRadius();
double d = r*r/Point2D.getDistance(pt, center);
double theta = Angle2D.getHorizontalAngle(center, pt);
return Point2D.createPolar(center, d, theta);
}
示例3: transform
import math.geom2d.Point2D; //导入方法依赖的package包/类
@Override
public CircleLine2D transform(CircleInversion2D inv) {
// Extract inversion parameters
Point2D center = inv.getCenter();
double r = inv.getRadius();
Point2D po = this.getProjectedPoint(center);
double d = this.getDistance(po);
// Degenerate case of a point belonging to the line:
// the transform is the line itself.
if (Math.abs(d)<Shape2D.ACCURACY){
return new StraightLine2D(this);
}
// angle from center to line
double angle = Angle2D.getHorizontalAngle(center, po);
// center of transformed circle
double r2 = r*r/d/2;
Point2D c2 = Point2D.createPolar(center, r2, angle);
// choose direction of circle arc
boolean direct = !this.isInside(center);
// return the created circle
return new Circle2D(c2, r2, direct);
}
示例4: transform
import math.geom2d.Point2D; //导入方法依赖的package包/类
public CirculinearElement2D transform(CircleInversion2D inv) {
// Extract inversion parameters
Point2D center = inv.getCenter();
double r = inv.getRadius();
// compute distance of line to inversion center
Point2D po = new StraightLine2D(this).getProjectedPoint(center);
double d = this.getDistance(po);
// Degenerate case of a line passing through the center.
// returns the line itself.
if (Math.abs(d)<Shape2D.ACCURACY){
Point2D p1 = this.getFirstPoint().transform(inv);
Point2D p2 = this.getLastPoint().transform(inv);
return new LineSegment2D(p1, p2);
}
// angle from center to line
double angle = Angle2D.getHorizontalAngle(center, po);
// center of transformed circle
double r2 = r*r/d/2;
Point2D c2 = Point2D.createPolar(center, r2, angle);
// choose direction of circle arc
boolean direct = !this.isInside(center);
// compute angle between center of transformed circle and end points
double theta1 = Angle2D.getHorizontalAngle(c2, p1);
double theta2 = Angle2D.getHorizontalAngle(c2, p2);
// create the new circle arc
return new CircleArc2D(c2, r2, theta1, theta2, direct);
}
示例5: getFocus1
import math.geom2d.Point2D; //导入方法依赖的package包/类
/**
* Return the first focus. It is defined as the first focus on the Major
* axis, in the direction given by angle theta.
*/
public Point2D getFocus1() {
double a, b, theta;
if (r1>r2) {
a = r1;
b = r2;
theta = this.theta;
} else {
a = r2;
b = r1;
theta = this.theta+Math.PI/2;
}
return Point2D.createPolar(xc, yc, Math.sqrt(a*a-b*b), theta+Math.PI);
}
示例6: getFocus2
import math.geom2d.Point2D; //导入方法依赖的package包/类
/**
* Returns the second focus. It is defined as the second focus on the Major
* axis, in the direction given by angle theta.
*/
public Point2D getFocus2() {
double a, b, theta;
if (r1>r2) {
a = r1;
b = r2;
theta = this.theta;
} else {
a = r2;
b = r1;
theta = this.theta+Math.PI/2;
}
return Point2D.createPolar(xc, yc, Math.sqrt(a*a-b*b), theta);
}