us.ihmc.robotics.geometry.GeometryTools.getOrthogonalProjectionOnPlane()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(72)

本文整理了Java中us.ihmc.robotics.geometry.GeometryTools.getOrthogonalProjectionOnPlane()方法的一些代码示例,展示了GeometryTools.getOrthogonalProjectionOnPlane()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GeometryTools.getOrthogonalProjectionOnPlane()方法的具体详情如下:
包路径:us.ihmc.robotics.geometry.GeometryTools
类名称:GeometryTools
方法名:getOrthogonalProjectionOnPlane

GeometryTools.getOrthogonalProjectionOnPlane介绍

[英]Computes the orthogonal projection of a 3D point on a given 3D plane defined by a 3D point and 3D normal.

Edge cases:

  • if the length of the plane normal is too small, i.e. less than Epsilons#ONE_TRILLIONTH, this method fails and returns false.
    [中]计算三维点在由三维点和三维法线定义的给定三维平面上的正交投影。
    边缘情况:
    *如果平面法线的长度太小,即小于ε1万亿分之一,则此方法失败并返回false。

代码示例

代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit

/**
* Computes the orthogonal projection of a 3D point on a given 3D plane defined by a 3D point and 3D normal.
* <p>
* Edge cases:
* <ul>
*    <li> if the length of the plane normal is too small, i.e. less than {@link Epsilons#ONE_TRILLIONTH},
*      this method fails and returns {@code false}.
* </ul>
* </p>
* 
* @param pointToProject the point to compute the projection of. Not modified.
* @param pointOnPlane a point on the plane. Not modified.
* @param planeNormal the normal of the plane. Not modified.
* @return the projection of the point onto the plane, or {@code null} if the method failed.
*/
public static Point3d getOrthogonalProjectionOnPlane(Point3d pointToProject, Point3d pointOnPlane, Vector3d planeNormal)
{
 Point3d projection = new Point3d();
 boolean success = getOrthogonalProjectionOnPlane(pointToProject, pointOnPlane, planeNormal, projection);
 if (!success)
   return null;
 else
   return projection;
}

代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit

/**
* Computes the orthogonal projection of a 3D point on a given 3D plane defined by a 3D point and 3D normal.
* <p>
* Edge cases:
* <ul>
*    <li> if the length of the plane normal is too small, i.e. less than {@link Epsilons#ONE_TRILLIONTH},
*      this method fails and returns {@code false}.
* </ul>
* </p>
* 
* @param pointToProject the point to compute the projection of. Not modified.
* @param pointOnPlane a point on the plane. Not modified.
* @param planeNormal the normal of the plane. Not modified.
* @return the projection of the point onto the plane, or {@code null} if the method failed.
* @throws ReferenceFrameMismatchException if the arguments are not expressed in the same reference frame.
*/
public static FramePoint getOrthogonalProjectionOnPlane(FramePoint pointToProject, FramePoint pointOnPlane, FrameVector planeNormal)
{
 FramePoint projection = new FramePoint();
 boolean success = getOrthogonalProjectionOnPlane(pointToProject, pointOnPlane, planeNormal, projection);
 if (!success)
   return null;
 else
   return projection;
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

/**
* Computes the orthogonal projection of a 3D point on a given 3D plane defined by a 3D point and 3D normal.
* <p>
* Edge cases:
* <ul>
*    <li> if the length of the plane normal is too small, i.e. less than {@link Epsilons#ONE_TRILLIONTH},
*      this method fails and returns {@code false}.
* </ul>
* </p>
* 
* @param pointToProject the point to compute the projection of. Not modified.
* @param pointOnPlane a point on the plane. Not modified.
* @param planeNormal the normal of the plane. Not modified.
* @return the projection of the point onto the plane, or {@code null} if the method failed.
* @throws ReferenceFrameMismatchException if the arguments are not expressed in the same reference frame.
*/
public static FramePoint3D getOrthogonalProjectionOnPlane(FramePoint3D pointToProject, FramePoint3D pointOnPlane, FrameVector3D planeNormal)
{
 FramePoint3D projection = new FramePoint3D();
 boolean success = getOrthogonalProjectionOnPlane(pointToProject, pointOnPlane, planeNormal, projection);
 if (!success)
   return null;
 else
   return projection;
}

代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit

/**
* Computes the orthogonal projection of a 3D point on a given 3D plane defined by a 3D point and 3D normal.
* <p>
* Edge cases:
* <ul>
*    <li> if the length of the plane normal is too small, i.e. less than {@link Epsilons#ONE_TRILLIONTH},
*      this method fails and returns {@code false}.
* </ul>
* </p>
* 
* @param pointToProject the point to compute the projection of. Not modified.
* @param pointOnPlane a point on the plane. Not modified.
* @param planeNormal the normal of the plane. Not modified.
* @param projectionToPack point in which the projection of the point onto the plane is stored. Modified.
* @return whether the method succeeded or not.
* @throws ReferenceFrameMismatchException if the arguments are not expressed in the same reference frame,
*  except for {@code projectionToPack}.
*/
public static boolean getOrthogonalProjectionOnPlane(FramePoint pointToProject, FramePoint pointOnPlane, FrameVector planeNormal,
                          FramePoint projectionToPack)
{
 pointToProject.checkReferenceFrameMatch(pointOnPlane);
 pointToProject.checkReferenceFrameMatch(planeNormal);
 projectionToPack.setToZero(pointToProject.getReferenceFrame());
 return getOrthogonalProjectionOnPlane(pointToProject.getPoint(), pointOnPlane.getPoint(), planeNormal.getVector(), projectionToPack.getPoint());
}

相关文章