package raytracer.common.object;
import raytracer.common.type.Ray;
import raytracer.common.type.Vector;
import raytracer.common.util.Solver;
public class Plan extends RtObject {
@Override
public double[] primitive(Ray ray) {
double coef[] = new double[2];
coef[0] = ray.getDirection().transformation(null, this.rotation).getZ();
coef[1] = ray.getOrigin().transformation(this.center, this.rotation).getZ();
return (Solver.deg1(coef));
}
@Override
public Vector normal(Vector inter) {
return (new Vector(0., 0., 1.).reverseRotation(this.rotation).normal());
}
}