Package raytracer.common.type

Examples of raytracer.common.type.Vector.scalarProduct()


  @Override
  public double[] primitive(Ray ray) {
    double coef[] = new double[3];
    Vector tmp = ray.getOrigin().add(this.center.product(-1.));
    coef[0] = ray.getDirection().scalarProduct(ray.getDirection());
    coef[1] = 2. * tmp.scalarProduct(ray.getDirection());
    coef[3] = tmp.scalarProduct(tmp) - this.rayon * this.rayon;
    return Solver.deg2(coef);
  }

  @Override
View Full Code Here


  public double[] primitive(Ray ray) {
    double coef[] = new double[3];
    Vector tmp = ray.getOrigin().add(this.center.product(-1.));
    coef[0] = ray.getDirection().scalarProduct(ray.getDirection());
    coef[1] = 2. * tmp.scalarProduct(ray.getDirection());
    coef[3] = tmp.scalarProduct(tmp) - this.rayon * this.rayon;
    return Solver.deg2(coef);
  }

  @Override
  public Vector normal(Vector inter) {
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.