コード例 #1
0
        public void ProjectOntoAxis(Vector axis, out double intervalMin, out double intervalMax)
        {
            Contract.Requires(axis.IsUnitVector);
            intervalMin = intervalMax = Vertex1.DotProduct(axis);

            double dist = Vertex2.DotProduct(axis);

            intervalMin = Math.Min(intervalMin, dist);
            intervalMax = Math.Max(intervalMax, dist);

            dist        = Vertex3.DotProduct(axis);
            intervalMin = Math.Min(intervalMin, dist);
            intervalMax = Math.Max(intervalMax, dist);
        }