本文整理汇总了C++中Bivector类的典型用法代码示例。如果您正苦于以下问题:C++ Bivector类的具体用法?C++ Bivector怎么用?C++ Bivector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Bivector类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TEST_F
TEST_F(PluginCompatibilityTest, PreBorel) {
serialization::Multivector message;
Vector<Length, Barycentric> const v({ -1 * Metre, 2 * Metre, 3 * Metre });
v.WriteToMessage(&message);
message.mutable_frame()->set_tag(serialization::Frame::PRE_BOREL_BARYCENTRIC);
Vector<Length, Barycentric> const w =
Vector<Length, Barycentric>::ReadFromMessage(message);
Vector<Length, Barycentric> const expected_w(
{ -1 * Metre, 3 * Metre, 2 * Metre });
EXPECT_EQ(expected_w, w);
Bivector<Length, Barycentric> const b({ 4 * Metre, 5 * Metre, -6 * Metre });
b.WriteToMessage(&message);
message.mutable_frame()->set_tag(serialization::Frame::PRE_BOREL_BARYCENTRIC);
Bivector<Length, Barycentric> const c =
Bivector<Length, Barycentric>::ReadFromMessage(message);
Bivector<Length, Barycentric> const expected_c(
{ -4 * Metre, 6 * Metre, -5 * Metre });
EXPECT_EQ(expected_c, c);
Trivector<Length, Barycentric> const t(-7 * Metre);
t.WriteToMessage(&message);
message.mutable_frame()->set_tag(serialization::Frame::PRE_BOREL_BARYCENTRIC);
Trivector<Length, Barycentric> const u =
Trivector<Length, Barycentric>::ReadFromMessage(message);
Trivector<Length, Barycentric> const expected_u(7 * Metre);
EXPECT_EQ(expected_u, u);
}
示例2: Exp
Rotation<Frame, Frame> Exp(Bivector<quantities::Angle, Frame> const& exponent) {
quantities::Angle const angle = exponent.Norm();
if (angle == quantities::Angle()) {
return Rotation<Frame, Frame>::Identity();
} else {
return Rotation<Frame, Frame>(angle, exponent);
}
}
示例3: GeometricAcceleration
Rotation<Frenet<ThisFrame>, ThisFrame>
DynamicFrame<InertialFrame, ThisFrame>::FrenetFrame(
Instant const& t,
DegreesOfFreedom<ThisFrame> const& degrees_of_freedom) const {
Velocity<ThisFrame> const& velocity = degrees_of_freedom.velocity();
Vector<Acceleration, ThisFrame> const acceleration =
GeometricAcceleration(t, degrees_of_freedom);
Vector<Acceleration, ThisFrame> normal_acceleration = acceleration;
velocity.template Orthogonalize<Acceleration>(&normal_acceleration);
Vector<double, ThisFrame> tangent = Normalize(velocity);
Vector<double, ThisFrame> normal = Normalize(normal_acceleration);
Bivector<double, ThisFrame> binormal = Wedge(tangent, normal);
// Maps |tangent| to {1, 0, 0}, |normal| to {0, 1, 0}, and |binormal| to
// {0, 0, 1}.
return Rotation<Frenet<ThisFrame>, ThisFrame>(
R3x3Matrix(tangent.coordinates(),
normal.coordinates(),
binormal.coordinates()).Transpose());
}
示例4:
Bivector<Scalar, ToFrame> Identity<FromFrame, ToFrame>::operator()(
Bivector<Scalar, FromFrame> const& bivector) const {
return Bivector<Scalar, ToFrame>(bivector.coordinates());
}
示例5:
Vector<quantities::Product<LScalar, RScalar>, Frame> operator*(
Trivector<LScalar, Frame> const& left,
Bivector<RScalar, Frame> const& right) {
return Vector<quantities::Product<LScalar, RScalar>, Frame>(
left.coordinates() * right.coordinates());
}
示例6: AngleBetween
quantities::Angle AngleBetween(Bivector<LScalar, Frame> const& v,
Bivector<RScalar, Frame> const& w) {
auto const v_norm_w = v * w.Norm();
auto const w_norm_v = w * v.Norm();
return 2 * ArcTan((v_norm_w - w_norm_v).Norm(), (v_norm_w + w_norm_v).Norm());
}
示例7: Commutator
Bivector<quantities::Product<LScalar, RScalar>, Frame> Commutator(
Bivector<LScalar, Frame> const& left,
Bivector<RScalar, Frame> const& right) {
return Bivector<quantities::Product<LScalar, RScalar>, Frame>(
Cross(left.coordinates(), right.coordinates()));
}
示例8: Wedge
Trivector<quantities::Product<LScalar, RScalar>, Frame> Wedge(
Vector<LScalar, Frame> const& left,
Bivector<RScalar, Frame> const& right) {
return Trivector<quantities::Product<LScalar, RScalar>, Frame>(
Dot(left.coordinates(), right.coordinates()));
}
示例9: InnerProduct
quantities::Product<LScalar, RScalar> InnerProduct(
Bivector<LScalar, Frame> const& left,
Bivector<RScalar, Frame> const& right) {
return Dot(left.coordinates(), right.coordinates());
}
示例10: Bivector
Bivector operator*(const BaseTransformation &transformation, const Bivector &bivector)
{
return Bivector(transformation * bivector.u(), transformation * bivector.v());
}
示例11: Exp
Rotation<Frame, Frame> Exp(Bivector<quantities::Angle, Frame> const& exponent) {
return Rotation<Frame, Frame>(exponent.Norm(), exponent);
}
示例12: Cross
inline Vector<quantities::Product<LScalar, RScalar>, Frame> operator*(
Bivector<LScalar, Frame> const& left,
Vector<RScalar, Frame> const& right) {
return Vector<quantities::Product<LScalar, RScalar>, Frame>(
Cross(left.coordinates(), right.coordinates()));
}
示例13: Determinant
Bivector<Scalar, ToFrame> Permutation<FromFrame, ToFrame>::operator()(
Bivector<Scalar, FromFrame> const& bivector) const {
return Bivector<Scalar, ToFrame>(
Determinant() * (*this)(bivector.coordinates()));
}