本文整理汇总了C++中Plan::Origin方法的典型用法代码示例。如果您正苦于以下问题:C++ Plan::Origin方法的具体用法?C++ Plan::Origin怎么用?C++ Plan::Origin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plan
的用法示例。
在下文中一共展示了Plan::Origin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetIntersectionPoint
Point InterceptorPlans::GetIntersectionPoint(const Plan & a, const Plan & b, const Vector & direction){
Vector AB = b.Origin()-a.Origin();
Basis baseA = a.Position();
Basis baseB = b.Position();
if((baseA.AxisZ()^direction) != Vector(0,0,0)){
double beta = ( (baseA.AxisY()*baseB.AxisY())*(AB*baseB.AxisY()) + ((baseA.AxisY()*baseB.AxisZ())*(AB*baseB.AxisZ()) - AB*baseA.AxisY()) )
/ ( (baseA.AxisY()*baseB.AxisY())*(baseA.AxisZ()*baseB.AxisY()) + (baseA.AxisY()*baseB.AxisZ())*(baseA.AxisZ()*baseB.AxisZ()));
return baseA.Origin() + beta*baseA.AxisZ();
}
else{
double beta = ( (baseA.AxisZ()*baseB.AxisY())*(AB*baseB.AxisY()) + ((baseA.AxisZ()*baseB.AxisZ())*(AB*baseB.AxisZ()) - AB*baseA.AxisZ()) )
/ ( (baseA.AxisZ()*baseB.AxisY())*(baseA.AxisY()*baseB.AxisY()) + (baseA.AxisY()*baseB.AxisZ())*(baseA.AxisZ()*baseB.AxisZ()));
return baseA.Origin() + beta*baseA.AxisY();
}
}