Examples of squaredLength()


Examples of ca.eandb.jmist.math.Vector3.squaredLength()

    } else {
      Point3 p = (Point3) a.getPosition();
      Point3 q = (Point3) b.getPosition();
      Vector3 v = p.vectorTo(q);
      return Math.max(a.getCosine(v), 0.0) * Math.max(b.getCosine(v.opposite()), 0.0)
          / v.squaredLength();
    }
  }

  public static boolean visibility(PathNode a, PathNode b) {
    Ray3 ray = Ray3.create(a.getPosition(), b.getPosition());
View Full Code Here

Examples of ca.eandb.jmist.math.Vector3.squaredLength()

   * @see ca.eandb.jmist.framework.Light#illuminate(ca.eandb.jmist.framework.SurfacePoint, ca.eandb.jmist.framework.color.WavelengthPacket, ca.eandb.jmist.framework.Random, ca.eandb.jmist.framework.Illuminable)
   */
  public void illuminate(SurfacePoint x, WavelengthPacket lambda, Random rng, Illuminable target) {

    Vector3    lightIn      = x.getPosition().vectorTo(this.position);
    double    dSquared    = lightIn.squaredLength();

    lightIn = lightIn.divide(Math.sqrt(dSquared));

    double    ndotl      = x.getShadingNormal().dot(lightIn);
    double    attenuation    = Math.abs(ndotl) / (4.0 * Math.PI * dSquared);
 
View Full Code Here

Examples of ca.eandb.jmist.math.Vector3.squaredLength()

    Vector3    orig      = ray.origin().vectorFromOrigin();
    Vector3    dir        = ray.direction().unit();
    double    sqRadius1    = major * major;
    double    sqRadius2    = minor * minor;
    double    s2NormOfDir    = dir.squaredLength();
    double    s2NormOfOrig  = orig.squaredLength();
    double    dirDotOrig    = dir.dot(orig);
    double    K        = s2NormOfOrig - (sqRadius1 + sqRadius2);

    Polynomial  f = new Polynomial(
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.