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

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

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

GeometryTools.getPerpendicularVectorFromLineToPoint介绍

[英]Computes the perpendicular defined by an infinitely long 3D line (defined by two 3D points) and a 3D point. To do so, the orthogonal projection of the point on line is first computed. The perpendicular vector is computed as follows: perpendicularVector = point - orthogonalProjection, resulting in a vector going from the computed projection to the given pointwith a length equal to the distance between the point and the line.

Edge cases:

  • when the distance between the two points defining the line is below Epsilons#ONE_TRILLIONTH, the method fails and returns null.

WARNING: This method generates garbage.
[中]计算由无限长的三维线(由两个三维点定义)和一个三维点定义的垂线。为此,首先计算点在直线上的正交投影。垂直向量的计算如下:垂直度向量=点-正交投影,从而得到从计算投影到给定点的向量,其长度等于点与线之间的距离。
边缘情况:
*当定义直线的两点之间的距离低于ε1万亿分之一时,该方法失败并返回null。
警告:此方法生成垃圾。

代码示例

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

boolean success = getPerpendicularVectorFromLineToPoint(point, firstPointOnLine, secondPointOnLine, orthogonalProjectionToPack, perpendicularVector);
if (!success)
  return null;

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

boolean success = getPerpendicularVectorFromLineToPoint(point, firstPointOnLine, secondPointOnLine, orthogonalProjectionToPack, perpendicularVector);
if (!success)
  return null;

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

boolean success = getPerpendicularVectorFromLineToPoint(point, firstPointOnLine, secondPointOnLine, orthogonalProjectionToPack, perpendicularVector);
if (!success)
  return null;

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

return getPerpendicularVectorFromLineToPoint(point.getPoint(), firstPointOnLine.getPoint(), secondPointOnLine.getPoint(), null,
                      perpendicularVectorToPack.getVector());
return getPerpendicularVectorFromLineToPoint(point.getPoint(), firstPointOnLine.getPoint(), secondPointOnLine.getPoint(),
                      orthogonalProjectionToPack.getPoint(), perpendicularVectorToPack.getVector());

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

x0.sub(point0, intersectionPoint0);
FrameVector3D expectedReturn0 = x0;
FrameVector3D actualReturn0 = GeometryTools.getPerpendicularVectorFromLineToPoint(point0, lineStart0, lineEnd0, intersectionPoint0);
x.sub(point, intersectionPoint);
FrameVector3D expectedReturn = x;
FrameVector3D actualReturn = GeometryTools.getPerpendicularVectorFromLineToPoint(point, lineStart, lineEnd, intersectionPoint);
assertTrue("Test Failed", expectedReturn.epsilonEquals(actualReturn, EPSILON));
x1.sub(point1, intersectionPoint1);
FrameVector3D expectedReturn1 = x1;
FrameVector3D actualReturn1 = GeometryTools.getPerpendicularVectorFromLineToPoint(point1, lineStart1, lineEnd1, intersectionPoint1);

相关文章