当前位置: 首页>>代码示例>>Java>>正文


Java Shape3D.ACCURACY属性代码示例

本文整理汇总了Java中math.geom3d.Shape3D.ACCURACY属性的典型用法代码示例。如果您正苦于以下问题:Java Shape3D.ACCURACY属性的具体用法?Java Shape3D.ACCURACY怎么用?Java Shape3D.ACCURACY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在math.geom3d.Shape3D的用法示例。


在下文中一共展示了Shape3D.ACCURACY属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPlaneIntersectionParametric

/** Compute intersection with a plane
 * 
 * @param plane plane to compute intersection with
 * @return parametric representation of the intersection or NaN
 */
public double getPlaneIntersectionParametric(Plane3D plane) {
    // the plane normal
    Vector3D planeNormal = plane.getNormalVector();

    double normalLineDot = Vector3D.dotProduct(planeNormal, getVector());
    if ( Math.abs(normalLineDot) < Shape3D.ACCURACY ) {
    	// right angle between plane normal and line vector => line is parallel to the plane
    	return Double.NaN;
    }
    
    // the difference between origin of plane and origin of line
    Vector3D dp = new Vector3D(getOrigin(), plane.getOrigin());
    
    // compute ratio of dot products,
    return Vector3D.dotProduct(planeNormal, dp) / normalLineDot;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:21,代码来源:StraightLine3D.java

示例2: getBoundingBox

@Override
public Box3D getBoundingBox() {
    // plane parallel to XY plane
    if (Math.abs(vector1.getZ())<Shape3D.ACCURACY&&Math.abs(vector2.getZ())<Shape3D.ACCURACY)
        return new Box3D(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
            Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
            origin.getZ(), origin.getZ());

    // plane parallel to YZ plane
    if (Math.abs(vector1.getX())<Shape3D.ACCURACY&&Math.abs(vector2.getX())<Shape3D.ACCURACY)
        return new Box3D(origin.getX(), origin.getX(),
            Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
            Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);

    // plane parallel to XZ plane
    if (Math.abs(vector1.getY())<Shape3D.ACCURACY&&Math.abs(vector2.getY())<Shape3D.ACCURACY)
        return new Box3D(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
            origin.getY(), origin.getY(),
            Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);

    return new Box3D(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
            Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
            Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:24,代码来源:Plane3D.java

示例3: boundingBox

public Box3D boundingBox() {
    Vector3D v = this.direction();

    // line parallel to (Ox) axis
    if (Math.hypot(v.getY(), v.getZ())<Shape3D.ACCURACY)
        return new Box3D(x0, x0, Double.NEGATIVE_INFINITY,
                Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY,
                Double.POSITIVE_INFINITY);

    // line parallel to (Oy) axis
    if (Math.hypot(v.getX(), v.getZ())<Shape3D.ACCURACY)
        return new Box3D(Double.NEGATIVE_INFINITY,
                Double.POSITIVE_INFINITY, y0, y0, Double.NEGATIVE_INFINITY,
                Double.POSITIVE_INFINITY);

    // line parallel to (Oz) axis
    if (Math.hypot(v.getX(), v.getY())<Shape3D.ACCURACY)
        return new Box3D(Double.NEGATIVE_INFINITY,
                Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY,
                Double.POSITIVE_INFINITY, z0, z0);

    return new Box3D(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
            Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
            Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
}
 
开发者ID:pokowaka,项目名称:android-geom,代码行数:25,代码来源:StraightLine3D.java

示例4: boundingBox

public Box3D boundingBox() {
    // plane parallel to XY plane
    if (Math.abs(dz1)<Shape3D.ACCURACY&&Math.abs(dz2)<Shape3D.ACCURACY)
        return new Box3D(Double.NEGATIVE_INFINITY,
                Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY,
                Double.POSITIVE_INFINITY, z0, z0);

    // plane parallel to YZ plane
    if (Math.abs(dx1)<Shape3D.ACCURACY&&Math.abs(dx2)<Shape3D.ACCURACY)
        return new Box3D(x0, x0, Double.NEGATIVE_INFINITY,
                Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY,
                Double.POSITIVE_INFINITY);

    // plane parallel to XZ plane
    if (Math.abs(dy1)<Shape3D.ACCURACY&&Math.abs(dy2)<Shape3D.ACCURACY)
        return new Box3D(Double.NEGATIVE_INFINITY,
                Double.POSITIVE_INFINITY, y0, y0, Double.NEGATIVE_INFINITY,
                Double.POSITIVE_INFINITY);

    return new Box3D(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
            Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
            Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
}
 
开发者ID:pokowaka,项目名称:android-geom,代码行数:23,代码来源:Plane3D.java

示例5: equals

@Override
public boolean equals(Object obj) {
    if (!(obj instanceof Plane3D))
        return false;
    Plane3D plane = (Plane3D) obj;

    if (Math.abs(this.x0-plane.x0)>Shape3D.ACCURACY)
        return false;
    if (Math.abs(this.y0-plane.y0)>Shape3D.ACCURACY)
        return false;
    if (Math.abs(this.z0-plane.z0)>Shape3D.ACCURACY)
        return false;
    if (Math.abs(this.dx1-plane.dx1)>Shape3D.ACCURACY)
        return false;
    if (Math.abs(this.dy1-plane.dy1)>Shape3D.ACCURACY)
        return false;
    if (Math.abs(this.dz1-plane.dz1)>Shape3D.ACCURACY)
        return false;
    if (Math.abs(this.dx2-plane.dx2)>Shape3D.ACCURACY)
        return false;
    if (Math.abs(this.dy2-plane.dy2)>Shape3D.ACCURACY)
        return false;
    if (Math.abs(this.dz2-plane.dz2)>Shape3D.ACCURACY)
        return false;
    return true;
}
 
开发者ID:pokowaka,项目名称:android-geom,代码行数:26,代码来源:Plane3D.java

示例6: equals

/**
 * Compares two transforms. Returns true if all inner fields are equal up to
 * the precision given by Shape3D.ACCURACY.
 */
@Override
public boolean equals(Object other) {
    if (other instanceof AffineTransform3D) {
        Matrix4d otherMatrix = ((AffineTransform3D) other).matrix;
        return (
            Math.abs(matrix.m00 - otherMatrix.m00)<= Shape3D.ACCURACY
            &&
            Math.abs(matrix.m01 - otherMatrix.m01)<= Shape3D.ACCURACY
            &&
            Math.abs(matrix.m02 - otherMatrix.m02)<= Shape3D.ACCURACY
            &&
            Math.abs(matrix.m03 - otherMatrix.m03)<= Shape3D.ACCURACY
            &&
            Math.abs(matrix.m10 - otherMatrix.m10)<= Shape3D.ACCURACY
            &&
            Math.abs(matrix.m11 - otherMatrix.m11)<= Shape3D.ACCURACY
            &&
            Math.abs(matrix.m12 - otherMatrix.m12)<= Shape3D.ACCURACY
            &&
            Math.abs(matrix.m13 - otherMatrix.m13)<= Shape3D.ACCURACY
            &&
            Math.abs(matrix.m20 - otherMatrix.m20)<= Shape3D.ACCURACY
            &&
            Math.abs(matrix.m21 - otherMatrix.m21)<= Shape3D.ACCURACY
            &&
            Math.abs(matrix.m22 - otherMatrix.m22)<= Shape3D.ACCURACY
            &&
            Math.abs(matrix.m23 - otherMatrix.m23)<= Shape3D.ACCURACY
            // rest should be ( 0, 0, 0, 1 ) in both matrices
        );
    } else {
        return false;
    }
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:38,代码来源:AffineTransform3D.java

示例7: contains

public boolean contains(Point3D point) {
    StraightLine3D line = this.getSupportingLine();
    if (!line.contains(point))
        return false;
    double t = line.getPosition(point);
    if (t<-Shape3D.ACCURACY)
        return false;
    if (t>1+Shape3D.ACCURACY)
        return false;
    return true;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:11,代码来源:LineSegment3D.java

示例8: getBoundingBox

@Override
  public Box3D getBoundingBox() {
      Vector3D v = this.getVector();

      // line parallel to (Ox) axis
      if (JavaGeomMath.hypot(v.getY(), v.getZ())<Shape3D.ACCURACY)
          return new Box3D(
      		origin.getX(), origin.getX(),
      		Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
      		Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY
  		);

      // line parallel to (Oy) axis
      if (JavaGeomMath.hypot(v.getX(), v.getZ())<Shape3D.ACCURACY)
          return new Box3D(
      		Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
      		origin.getY(), origin.getY(),
      		Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY
  		);

      // line parallel to (Oz) axis
      if (JavaGeomMath.hypot(v.getX(), v.getY())<Shape3D.ACCURACY)
          return new Box3D(
      		Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
      		Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
      		origin.getZ(), origin.getZ()
  		);

      return new Box3D(
	Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
	Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY,
	Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY
);
  }
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:34,代码来源:StraightLine3D.java

示例9: equals

/**
   * Compares two transforms. Returns true if all inner fields are equal up to
   * the precision given by Shape3D.ACCURACY.
   */
  @Override
  public boolean equals(Object obj) {
      if (!(obj instanceof AffineTransform3D))
          return false;

      double tab[] = ((AffineTransform3D) obj).coefficients();

if (Math.abs(tab[0] - m00) > Shape3D.ACCURACY)
	return false;
if (Math.abs(tab[1] - m01) > Shape3D.ACCURACY)
	return false;
if (Math.abs(tab[2] - m02) > Shape3D.ACCURACY)
	return false;
if (Math.abs(tab[3] - m03) > Shape3D.ACCURACY)
	return false;
if (Math.abs(tab[4] - m10) > Shape3D.ACCURACY)
	return false;
if (Math.abs(tab[5] - m11) > Shape3D.ACCURACY)
	return false;
if (Math.abs(tab[6] - m12) > Shape3D.ACCURACY)
	return false;
if (Math.abs(tab[7] - m13) > Shape3D.ACCURACY)
	return false;
if (Math.abs(tab[8] - m20) > Shape3D.ACCURACY)
	return false;
if (Math.abs(tab[9] - m21) > Shape3D.ACCURACY)
	return false;
if (Math.abs(tab[10] - m22) > Shape3D.ACCURACY)
	return false;
if (Math.abs(tab[11] - m23) > Shape3D.ACCURACY)
	return false;
      return true;
  }
 
开发者ID:pokowaka,项目名称:android-geom,代码行数:37,代码来源:AffineTransform3D.java

示例10: contains

public boolean contains(Point3D point) {
    StraightLine3D line = this.supportingLine();
    if (!line.contains(point))
        return false;
    double t = line.position(point);
    if (t<-Shape3D.ACCURACY)
        return false;
    if (t>1+Shape3D.ACCURACY)
        return false;
    return true;
}
 
开发者ID:pokowaka,项目名称:android-geom,代码行数:11,代码来源:LineSegment3D.java

示例11: contains

@Override
public boolean contains(Point3D point) {
    return this.getDistance(point)<Shape3D.ACCURACY;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:4,代码来源:StraightLine3D.java

示例12: contains

@Override
public boolean contains(Point3D point) {
    Point3D proj = this.project(point);
    return (point.getDistanceSquare(proj)<(Shape3D.ACCURACY*Shape3D.ACCURACY));
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:5,代码来源:Plane3D.java

示例13: contains

public boolean contains(Point3D point) {
    return this.distance(point) < Shape3D.ACCURACY;
}
 
开发者ID:pokowaka,项目名称:android-geom,代码行数:3,代码来源:StraightLine3D.java

示例14: contains

public boolean contains(Point3D point) {
    Point3D proj = this.projectPoint(point);
    return (point.distance(proj)<Shape3D.ACCURACY);
}
 
开发者ID:pokowaka,项目名称:android-geom,代码行数:4,代码来源:Plane3D.java


注:本文中的math.geom3d.Shape3D.ACCURACY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。