protected internal virtual double DistanceFrom(Tuple4 point) { if (point.IsVector()) { throw new ArgumentException("Argument is not a point"); } throw new NotImplementedException(); }
public static Tuple4 MovePoint(Tuple4 origin, Tuple4 dir, double t) { if (!dir.IsVector()) { throw new ArgumentException("Not a vector"); } return(new Tuple4( origin.X + t * dir.X, origin.Y + t * dir.Y, origin.Z + t * dir.Z, TupleFlavour.Point )); }
public Ray(Tuple4 origin, Tuple4 dir) { if (!origin.IsPoint()) { throw new ArgumentException("Not a point", nameof(origin)); } if (!dir.IsVector()) { throw new ArgumentException("Not a vector", nameof(dir)); } this.origin = origin; this.dir = dir; }