Package ca.eandb.jmist.math

Examples of ca.eandb.jmist.math.Point3.y()


    Point3 p = x.getPosition();
    switch (x.getTag()) {
    case CONE_SURFACE_BODY:
      double angle = Math.PI + Math.atan2(p.z(), p.x());
      return new Point2(angle / ((capped ? 4.0 : 2.0) * Math.PI),
          p.y() / height);

    case CONE_SURFACE_BASE:
      return new Point2(0.5 + (p.x() + radius) / (4.0 * radius),
          (p.z() + radius) / (4.0 * radius));

 
View Full Code Here


    if (t.length == 2) {
      for (int i = 0; i < 2; i++) {
        if (recorder.interval().contains(t[i])) {
          Point3 p = ray.pointAt(t[i]);
          if (MathUtil.inRangeCC(p.y(),
              Math.min(height1, height2),
              Math.max(height1, height2))) {
            Intersection x = super.newIntersection(ray, t[i], i == 0, TAPERED_CYLINDER_SURFACE_BODY)
              .setLocation(p);
            recorder.record(x);
View Full Code Here

      double det = radius1 * height2 - radius2 * height1;
      Point3 p = x.getPosition();

      return Vector3.unit(
          p.x() * dh2,
          -dr * (dr * p.y() + det),
          p.z() * dh2);
//
//      double dh = height2 - height1;
//      double dr = radius2 - radius1;
//      double side = Math.hypot(dr, dh);
View Full Code Here

    Point3 p = x.getPosition();
    switch (x.getTag()) {
    case TAPERED_CYLINDER_SURFACE_BODY:
      double angle = Math.PI + Math.atan2(p.z(), p.x());
      return new Point2(angle / ((capped ? 4.0 : 2.0) * Math.PI),
          (p.y() - height1) / (height2 - height1));

    case TAPERED_CYLINDER_SURFACE_END_1:
      return new Point2(0.5 + (p.x() + radius1) / (4.0 * radius1),
          (p.z() + radius1) / (4.0 * radius1));

 
View Full Code Here

    if (x.length == 2)
    {
      // for each solution, make sure the point lies between the base and the apex
      p = ray.pointAt(x[0]);
      if (MathUtil.inRangeOO(p.y(), this.base.y(), this.base.y() + this.height))
      {
        Intersection isect = super.newIntersection(ray, x[0], (x[0] < x[1]), CYLINDER_SURFACE_BODY)
          .setLocation(p);

        recorder.record(isect);
View Full Code Here

        recorder.record(isect);
      }

      p = ray.pointAt(x[1]);
      if (MathUtil.inRangeOO(p.y(), this.base.y(), this.base.y() + this.height))
      {
        Intersection isect = super.newIntersection(ray, x[1], (x[0] > x[1]), CYLINDER_SURFACE_BODY)
          .setLocation(p);

        recorder.record(isect);
View Full Code Here

  private EvaluateResult evaluate(Ray3 ray, double t) {

    Point3  p = ray.pointAt(t);
    Vector3  d = ray.direction();
    double  X2e_1 = Math.pow(Math.abs(p.x()), 2.0 / e - 1.0);
    double  Y2e_1 = Math.pow(Math.abs(p.y()), 2.0 / e - 1.0);
    double  Z2n_1 = Math.pow(Math.abs(p.z()), 2.0 / n - 1.0);
    double  X2e = Math.abs(p.x()) * X2e_1;
    double  Y2e = Math.abs(p.y()) * Y2e_1;
    double  Z2n = Math.abs(p.z()) * Z2n_1;
    double  A_1 = Math.pow(X2e + Y2e, e / n - 1.0);
View Full Code Here

    Vector3  d = ray.direction();
    double  X2e_1 = Math.pow(Math.abs(p.x()), 2.0 / e - 1.0);
    double  Y2e_1 = Math.pow(Math.abs(p.y()), 2.0 / e - 1.0);
    double  Z2n_1 = Math.pow(Math.abs(p.z()), 2.0 / n - 1.0);
    double  X2e = Math.abs(p.x()) * X2e_1;
    double  Y2e = Math.abs(p.y()) * Y2e_1;
    double  Z2n = Math.abs(p.z()) * Z2n_1;
    double  A_1 = Math.pow(X2e + Y2e, e / n - 1.0);
    double  A = (X2e + Y2e) * A_1;

    return new EvaluateResult(
View Full Code Here

    return new EvaluateResult(
        A + Z2n - 1.0,
        (2.0 / n)
        * (A_1
            * (X2e_1 * d.x() * Math.signum(p.x()) + Y2e_1 * d.y()
                * Math.signum(p.y())) + Z2n_1 * d.z()
            * Math.signum(p.z()))
    );

  }

View Full Code Here

   */
  @Override
  protected Vector3 getNormal(GeometryIntersection x) {

    Point3  p = x.getPosition();
    double  A = Math.pow(Math.pow(Math.abs(p.x()), 2.0 / e) + Math.pow(Math.abs(p.y()), 2.0 / e), e / n - 1.0);
    double  X = A * Math.pow(Math.abs(p.x()), 2.0 / e - 1.0);
    double  Y = A * Math.pow(Math.abs(p.y()), 2.0 / e - 1.0);
    double  Z = Math.pow(Math.abs(p.z()), 2.0 / n - 1.0);

    return new Vector3(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.