Usages of

.getPoint()
@Override public Point3D intersects(Ray r, World w) { Point3D i = null; double dp = consts.dot(r.getVector()); if ( dp != 0 ) { double t = -(consts.dot(r.getPoint()) + d) / dp; if (t > 0) { i = r.getPoint().plus(r.getVector().multiply(t)); } } return i; }
public Point3D intersects(Ray ray, World w) { Point3D unit = ray.getVector().normalized(); Point3D p = ray.getPoint(); double alpha = -p.minus(pos).dot(unit); Point3D q = p.plus(unit.multiply(alpha)); double bSq = q.minus(pos).abs_squared(); if (bSq > r*r) return null; double a = Math.sqrt(r*r - bSq); if (alpha >= a) { Point3D q1 = q.minus(unit.multiply(a)); return q1; } if (alpha + a > 0) { Point3D q2 = q.plus(unit.multiply(a)); return q2; } return null; }
Usage snippet has been bookmarked! Review your bookmarks
Thank you! Review your likes