diff --git a/corsika/detail/framework/geometry/Point.inl b/corsika/detail/framework/geometry/Point.inl index fe6e8b162383352523f7ba2399ef8685b0b5a2cb..156723dd149102ecec8ee88ab773dafa5cfec84d 100644 --- a/corsika/detail/framework/geometry/Point.inl +++ b/corsika/detail/framework/geometry/Point.inl @@ -24,46 +24,22 @@ namespace corsika { } inline LengthType Point::getX(CoordinateSystemPtr const& pCS) const { - CoordinateSystemPtr const& cs = BaseVector<length_d>::getCoordinateSystem(); - if (*pCS == *cs) { - return BaseVector<length_d>::getQuantityVector().getX(); - } else { - return QuantityVector<length_d>( - get_transformation(*cs.get(), *pCS.get()) * - BaseVector<length_d>::getQuantityVector().eigenVector_) - .getX(); - } + return getCoordinates(pCS).getX(); } inline LengthType Point::getY(CoordinateSystemPtr const& pCS) const { - CoordinateSystemPtr const& cs = BaseVector<length_d>::getCoordinateSystem(); - if (*pCS == *cs) { - return BaseVector<length_d>::getQuantityVector().getY(); - } else { - return QuantityVector<length_d>( - get_transformation(*cs.get(), *pCS.get()) * - BaseVector<length_d>::getQuantityVector().eigenVector_) - .getY(); - } + return getCoordinates(pCS).getY(); } inline LengthType Point::getZ(CoordinateSystemPtr const& pCS) const { - CoordinateSystemPtr const& cs = BaseVector<length_d>::getCoordinateSystem(); - if (*pCS == *cs) { - return BaseVector<length_d>::getQuantityVector().getZ(); - } else { - return QuantityVector<length_d>( - get_transformation(*cs.get(), *pCS.get()) * - BaseVector<length_d>::getQuantityVector().eigenVector_) - .getZ(); - } + return getCoordinates(pCS).getZ(); } /// this always returns a QuantityVector as triple inline QuantityVector<length_d> Point::getCoordinates( CoordinateSystemPtr const& pCS) const { CoordinateSystemPtr const& cs = BaseVector<length_d>::getCoordinateSystem(); - if (*pCS == *cs) { + if (pCS == cs) { return BaseVector<length_d>::getQuantityVector(); } else { return QuantityVector<length_d>( @@ -74,7 +50,7 @@ namespace corsika { /// this always returns a QuantityVector as triple inline QuantityVector<length_d>& Point::getCoordinates(CoordinateSystemPtr const& pCS) { - if (*pCS != *BaseVector<length_d>::getCoordinateSystem()) { rebase(pCS); } + if (pCS != BaseVector<length_d>::getCoordinateSystem()) { rebase(pCS); } return BaseVector<length_d>::getQuantityVector(); } @@ -106,4 +82,4 @@ namespace corsika { return (p1 - p2).getNorm(); } -} // namespace corsika \ No newline at end of file +} // namespace corsika diff --git a/corsika/detail/framework/geometry/Vector.inl b/corsika/detail/framework/geometry/Vector.inl index 0e2cfdd6104bd4062d3bf752c43e7ffc858fe70a..687b93eebd91346fc7c46da7492cfabeb8d2a73e 100644 --- a/corsika/detail/framework/geometry/Vector.inl +++ b/corsika/detail/framework/geometry/Vector.inl @@ -27,7 +27,7 @@ namespace corsika { template <typename TDimension> inline QuantityVector<TDimension> Vector<TDimension>::getComponents( CoordinateSystemPtr const& pCS) const { - if (*pCS == *BaseVector<TDimension>::getCoordinateSystem()) { + if (pCS == BaseVector<TDimension>::getCoordinateSystem()) { return BaseVector<TDimension>::getQuantityVector(); } else { return QuantityVector<TDimension>(