Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:46

0001 // Copyright (c) 1991-1999 Matra Datavision
0002 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef _gp_XYZ_HeaderFile
0016 #define _gp_XYZ_HeaderFile
0017 
0018 #include <gp.hxx>
0019 #include <gp_Mat.hxx>
0020 #include <Standard_ConstructionError.hxx>
0021 #include <Standard_OutOfRange.hxx>
0022 #include <Standard_OStream.hxx>
0023 #include <Standard_SStream.hxx>
0024 
0025 //! This class describes a cartesian coordinate entity in
0026 //! 3D space {X,Y,Z}. This entity is used for algebraic
0027 //! calculation. This entity can be transformed
0028 //! with a "Trsf" or a  "GTrsf" from package "gp".
0029 //! It is used in vectorial computations or for holding this type
0030 //! of information in data structures.
0031 class gp_XYZ 
0032 {
0033 public:
0034 
0035   DEFINE_STANDARD_ALLOC
0036 
0037   //! Creates an XYZ object with zero coordinates (0,0,0)
0038   gp_XYZ()
0039   : x (0.),
0040     y (0.),
0041     z (0.)
0042   {}
0043 
0044   //! creates an XYZ with given coordinates
0045   gp_XYZ (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ)
0046   : x (theX),
0047     y (theY),
0048     z (theZ)
0049   {}
0050 
0051   //! For this XYZ object, assigns
0052   //! the values theX, theY and theZ to its three coordinates
0053   void SetCoord (const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ)
0054   {
0055     x = theX;
0056     y = theY;
0057     z = theZ;
0058   }
0059 
0060   //! modifies the coordinate of range theIndex
0061   //! theIndex = 1 => X is modified
0062   //! theIndex = 2 => Y is modified
0063   //! theIndex = 3 => Z is modified
0064   //! Raises OutOfRange if theIndex != {1, 2, 3}.
0065   void SetCoord (const Standard_Integer theIndex, const Standard_Real theXi)
0066   {
0067     Standard_OutOfRange_Raise_if (theIndex < 1 || theIndex > 3, NULL);
0068     (&x)[theIndex - 1] = theXi;
0069   }
0070 
0071   //! Assigns the given value to the X coordinate
0072   void SetX (const Standard_Real theX) { x = theX; }
0073 
0074   //! Assigns the given value to the Y coordinate
0075   void SetY (const Standard_Real theY) { y = theY; }
0076 
0077   //! Assigns the given value to the Z coordinate
0078   void SetZ (const Standard_Real theZ) { z = theZ; }
0079 
0080   //! returns the coordinate of range theIndex :
0081   //! theIndex = 1 => X is returned
0082   //! theIndex = 2 => Y is returned
0083   //! theIndex = 3 => Z is returned
0084   //!
0085   //! Raises OutOfRange if theIndex != {1, 2, 3}.
0086   Standard_Real Coord (const Standard_Integer theIndex) const
0087   {
0088     Standard_OutOfRange_Raise_if (theIndex < 1 || theIndex > 3, NULL);
0089     return (&x)[theIndex - 1];
0090   }
0091 
0092   Standard_Real& ChangeCoord (const Standard_Integer theIndex)
0093   {
0094     Standard_OutOfRange_Raise_if (theIndex < 1 || theIndex > 3, NULL);
0095     return (&x)[theIndex - 1];
0096   }
0097 
0098   void Coord (Standard_Real& theX, Standard_Real& theY, Standard_Real& theZ) const
0099   {
0100     theX = x;
0101     theY = y;
0102     theZ = z;
0103   }
0104 
0105   //! Returns a const ptr to coordinates location.
0106   //! Is useful for algorithms, but DOES NOT PERFORM
0107   //! ANY CHECKS!
0108   const Standard_Real* GetData() const { return (&x); }
0109 
0110   //! Returns a ptr to coordinates location.
0111   //! Is useful for algorithms, but DOES NOT PERFORM
0112   //! ANY CHECKS!
0113   Standard_Real* ChangeData() { return (&x); }
0114 
0115   //! Returns the X coordinate
0116   Standard_Real X() const { return x; }
0117 
0118   //! Returns the Y coordinate
0119   Standard_Real Y() const { return y; }
0120 
0121   //! Returns the Z coordinate
0122   Standard_Real Z() const { return z; }
0123 
0124   //! computes Sqrt (X*X + Y*Y + Z*Z) where X, Y and Z are the three coordinates of this XYZ object.
0125   Standard_Real Modulus() const { return sqrt (x * x + y * y + z * z); }
0126 
0127   //! Computes X*X + Y*Y + Z*Z where X, Y and Z are the three coordinates of this XYZ object.
0128   Standard_Real SquareModulus() const { return (x * x + y * y + z * z); }
0129 
0130   //! Returns True if he coordinates of this XYZ object are
0131   //! equal to the respective coordinates Other,
0132   //! within the specified tolerance theTolerance. I.e.:
0133   //! abs(<me>.X() - theOther.X()) <= theTolerance and
0134   //! abs(<me>.Y() - theOther.Y()) <= theTolerance and
0135   //! abs(<me>.Z() - theOther.Z()) <= theTolerance.
0136   Standard_EXPORT Standard_Boolean IsEqual (const gp_XYZ& theOther, const Standard_Real theTolerance) const;
0137 
0138   //! @code
0139   //! <me>.X() = <me>.X() + theOther.X()
0140   //! <me>.Y() = <me>.Y() + theOther.Y()
0141   //! <me>.Z() = <me>.Z() + theOther.Z()
0142   //! @endcode
0143   void Add (const gp_XYZ& theOther)
0144   {
0145     x += theOther.x;
0146     y += theOther.y;
0147     z += theOther.z;
0148   }
0149 
0150   void operator+= (const gp_XYZ& theOther) { Add (theOther); }
0151 
0152   //! @code
0153   //! new.X() = <me>.X() + theOther.X()
0154   //! new.Y() = <me>.Y() + theOther.Y()
0155   //! new.Z() = <me>.Z() + theOther.Z()
0156   //! @endcode
0157   Standard_NODISCARD gp_XYZ Added (const gp_XYZ& theOther) const
0158   {
0159     return gp_XYZ (x + theOther.x, y + theOther.y, z + theOther.z);
0160   }
0161 
0162   Standard_NODISCARD gp_XYZ operator + (const gp_XYZ& theOther) const { return Added (theOther); }
0163 
0164   //! @code
0165   //! <me>.X() = <me>.Y() * theOther.Z() - <me>.Z() * theOther.Y()
0166   //! <me>.Y() = <me>.Z() * theOther.X() - <me>.X() * theOther.Z()
0167   //! <me>.Z() = <me>.X() * theOther.Y() - <me>.Y() * theOther.X()
0168   //! @endcode
0169   void Cross (const gp_XYZ& theOther);
0170 
0171   void operator^= (const gp_XYZ& theOther) { Cross (theOther); }
0172 
0173   //! @code
0174   //! new.X() = <me>.Y() * theOther.Z() - <me>.Z() * theOther.Y()
0175   //! new.Y() = <me>.Z() * theOther.X() - <me>.X() * theOther.Z()
0176   //! new.Z() = <me>.X() * theOther.Y() - <me>.Y() * theOther.X()
0177   //! @endcode
0178   Standard_NODISCARD gp_XYZ Crossed (const gp_XYZ& theOther) const
0179   {
0180     return gp_XYZ (y * theOther.z - z * theOther.y,
0181                    z * theOther.x - x * theOther.z,
0182                    x * theOther.y - y * theOther.x);
0183   }
0184 
0185   Standard_NODISCARD gp_XYZ operator ^ (const gp_XYZ& theOther) const { return Crossed (theOther); }
0186 
0187   //! Computes the magnitude of the cross product between <me> and
0188   //! theRight. Returns || <me> ^ theRight ||
0189   Standard_Real CrossMagnitude (const gp_XYZ& theRight) const;
0190 
0191   //! Computes the square magnitude of the cross product between <me> and
0192   //! theRight. Returns || <me> ^ theRight ||**2
0193   Standard_Real CrossSquareMagnitude (const gp_XYZ& theRight) const;
0194 
0195   //! Triple vector product
0196   //! Computes <me> = <me>.Cross(theCoord1.Cross(theCoord2))
0197   void CrossCross (const gp_XYZ& theCoord1, const gp_XYZ& theCoord2);
0198 
0199   //! Triple vector product
0200   //! computes New = <me>.Cross(theCoord1.Cross(theCoord2))
0201   Standard_NODISCARD gp_XYZ CrossCrossed (const gp_XYZ& theCoord1, const gp_XYZ& theCoord2) const
0202   {
0203     gp_XYZ aCoord0 = *this;
0204     aCoord0.CrossCross (theCoord1, theCoord2);
0205     return aCoord0;
0206   }
0207 
0208   //! divides <me> by a real.
0209   void Divide (const Standard_Real theScalar)
0210   {
0211     x /= theScalar;
0212     y /= theScalar;
0213     z /= theScalar;
0214   }
0215 
0216   void operator/= (const Standard_Real theScalar) { Divide (theScalar); }
0217 
0218   //! divides <me> by a real.
0219   Standard_NODISCARD gp_XYZ Divided (const Standard_Real theScalar) const { return gp_XYZ (x / theScalar, y / theScalar, z / theScalar); }
0220 
0221   Standard_NODISCARD gp_XYZ operator/ (const Standard_Real theScalar) const { return Divided (theScalar); }
0222 
0223   //! computes the scalar product between <me> and theOther
0224   Standard_Real Dot (const gp_XYZ& theOther) const { return(x * theOther.x + y * theOther.y + z * theOther.z); }
0225 
0226   Standard_Real operator* (const gp_XYZ& theOther) const { return Dot (theOther); }
0227 
0228   //! computes the triple scalar product
0229   Standard_Real DotCross (const gp_XYZ& theCoord1, const gp_XYZ& theCoord2) const;
0230 
0231   //! @code
0232   //! <me>.X() = <me>.X() * theScalar;
0233   //! <me>.Y() = <me>.Y() * theScalar;
0234   //! <me>.Z() = <me>.Z() * theScalar;
0235   //! @endcode
0236   void Multiply (const Standard_Real theScalar)
0237   {
0238     x *= theScalar;
0239     y *= theScalar;
0240     z *= theScalar;
0241   }
0242 
0243   void operator*= (const Standard_Real theScalar) { Multiply (theScalar); }
0244 
0245   //! @code
0246   //! <me>.X() = <me>.X() * theOther.X();
0247   //! <me>.Y() = <me>.Y() * theOther.Y();
0248   //! <me>.Z() = <me>.Z() * theOther.Z();
0249   //! @endcode
0250   void Multiply (const gp_XYZ& theOther)
0251   {
0252     x *= theOther.x;
0253     y *= theOther.y;
0254     z *= theOther.z;
0255   }
0256 
0257   void operator*= (const gp_XYZ& theOther) { Multiply (theOther); }
0258 
0259   //! <me> = theMatrix * <me>
0260   void Multiply (const gp_Mat& theMatrix);
0261 
0262   void operator*= (const gp_Mat& theMatrix) { Multiply (theMatrix); }
0263 
0264   //! @code
0265   //! New.X() = <me>.X() * theScalar;
0266   //! New.Y() = <me>.Y() * theScalar;
0267   //! New.Z() = <me>.Z() * theScalar;
0268   //! @endcode
0269   Standard_NODISCARD gp_XYZ Multiplied (const Standard_Real theScalar) const { return gp_XYZ (x * theScalar, y * theScalar, z * theScalar); }
0270 
0271   Standard_NODISCARD gp_XYZ operator* (const Standard_Real theScalar) const { return Multiplied (theScalar); }
0272 
0273   //! @code
0274   //! new.X() = <me>.X() * theOther.X();
0275   //! new.Y() = <me>.Y() * theOther.Y();
0276   //! new.Z() = <me>.Z() * theOther.Z();
0277   //! @endcode
0278   Standard_NODISCARD gp_XYZ Multiplied (const gp_XYZ& theOther) const { return gp_XYZ (x * theOther.x, y * theOther.y, z * theOther.z); }
0279 
0280   //! New = theMatrix * <me>
0281   Standard_NODISCARD gp_XYZ Multiplied (const gp_Mat& theMatrix) const
0282   {
0283     return gp_XYZ (theMatrix.Value (1, 1) * x + theMatrix.Value (1, 2) * y + theMatrix.Value (1, 3) * z,
0284                    theMatrix.Value (2, 1) * x + theMatrix.Value (2, 2) * y + theMatrix.Value (2, 3) * z,
0285                    theMatrix.Value (3, 1) * x + theMatrix.Value (3, 2) * y + theMatrix.Value (3, 3) * z);
0286   }
0287 
0288   Standard_NODISCARD gp_XYZ operator* (const gp_Mat& theMatrix) const { return Multiplied (theMatrix); }
0289 
0290   //! @code
0291   //! <me>.X() = <me>.X()/ <me>.Modulus()
0292   //! <me>.Y() = <me>.Y()/ <me>.Modulus()
0293   //! <me>.Z() = <me>.Z()/ <me>.Modulus()
0294   //! @endcode
0295   //! Raised if <me>.Modulus() <= Resolution from gp
0296   void Normalize();
0297 
0298   //! @code
0299   //! New.X() = <me>.X()/ <me>.Modulus()
0300   //! New.Y() = <me>.Y()/ <me>.Modulus()
0301   //! New.Z() = <me>.Z()/ <me>.Modulus()
0302   //! @endcode
0303   //! Raised if <me>.Modulus() <= Resolution from gp
0304   Standard_NODISCARD gp_XYZ Normalized() const
0305   {
0306     Standard_Real aD = Modulus();
0307     Standard_ConstructionError_Raise_if (aD <= gp::Resolution(), "gp_XYZ::Normalized() - vector has zero norm");
0308     return gp_XYZ(x / aD, y / aD, z / aD);
0309   }
0310 
0311   //! @code
0312   //! <me>.X() = -<me>.X()
0313   //! <me>.Y() = -<me>.Y()
0314   //! <me>.Z() = -<me>.Z()
0315   //! @endcode
0316   void Reverse()
0317   {
0318     x = -x;
0319     y = -y;
0320     z = -z;
0321   }
0322 
0323   //! @code
0324   //! New.X() = -<me>.X()
0325   //! New.Y() = -<me>.Y()
0326   //! New.Z() = -<me>.Z()
0327   //! @endcode
0328   Standard_NODISCARD gp_XYZ Reversed() const { return gp_XYZ (-x, -y, -z); }
0329 
0330   //! @code
0331   //! <me>.X() = <me>.X() - theOther.X()
0332   //! <me>.Y() = <me>.Y() - theOther.Y()
0333   //! <me>.Z() = <me>.Z() - theOther.Z()
0334   //! @endcode
0335   void Subtract (const gp_XYZ& theOther)
0336   {
0337     x -= theOther.x;
0338     y -= theOther.y;
0339     z -= theOther.z;
0340   }
0341 
0342   void operator-= (const gp_XYZ& theOther) { Subtract (theOther); }
0343 
0344   //! @code
0345   //! new.X() = <me>.X() - theOther.X()
0346   //! new.Y() = <me>.Y() - theOther.Y()
0347   //! new.Z() = <me>.Z() - theOther.Z()
0348   //! @endcode
0349   Standard_NODISCARD gp_XYZ Subtracted (const gp_XYZ& theOther) const { return gp_XYZ (x - theOther.x, y - theOther.y, z - theOther.z); }
0350 
0351   Standard_NODISCARD gp_XYZ operator-  (const gp_XYZ& theOther) const { return Subtracted (theOther); }
0352 
0353   //! <me> is set to the following linear form :
0354   //! @code
0355   //! theA1 * theXYZ1 + theA2 * theXYZ2 + theA3 * theXYZ3 + theXYZ4
0356   //! @endcode
0357   void SetLinearForm (const Standard_Real theA1, const gp_XYZ& theXYZ1,
0358                       const Standard_Real theA2, const gp_XYZ& theXYZ2,
0359                       const Standard_Real theA3, const gp_XYZ& theXYZ3,
0360                       const gp_XYZ& theXYZ4)
0361   {
0362     x = theA1 * theXYZ1.x + theA2 * theXYZ2.x + theA3 * theXYZ3.x + theXYZ4.x;
0363     y = theA1 * theXYZ1.y + theA2 * theXYZ2.y + theA3 * theXYZ3.y + theXYZ4.y;
0364     z = theA1 * theXYZ1.z + theA2 * theXYZ2.z + theA3 * theXYZ3.z + theXYZ4.z;
0365   }
0366 
0367   //! <me> is set to the following linear form :
0368   //! @code
0369   //! theA1 * theXYZ1 + theA2 * theXYZ2 + theA3 * theXYZ3
0370   //! @endcode
0371   void SetLinearForm (const Standard_Real theA1, const gp_XYZ& theXYZ1,
0372                       const Standard_Real theA2, const gp_XYZ& theXYZ2,
0373                       const Standard_Real theA3, const gp_XYZ& theXYZ3)
0374   {
0375     x = theA1 * theXYZ1.x + theA2 * theXYZ2.x + theA3 * theXYZ3.x;
0376     y = theA1 * theXYZ1.y + theA2 * theXYZ2.y + theA3 * theXYZ3.y;
0377     z = theA1 * theXYZ1.z + theA2 * theXYZ2.z + theA3 * theXYZ3.z;
0378   }
0379 
0380   //! <me> is set to the following linear form :
0381   //! @code
0382   //! theA1 * theXYZ1 + theA2 * theXYZ2 + theXYZ3
0383   //! @endcode
0384   void SetLinearForm (const Standard_Real theA1, const gp_XYZ& theXYZ1,
0385                       const Standard_Real theA2, const gp_XYZ& theXYZ2,
0386                       const gp_XYZ& theXYZ3)
0387   {
0388     x = theA1 * theXYZ1.x + theA2 * theXYZ2.x + theXYZ3.x;
0389     y = theA1 * theXYZ1.y + theA2 * theXYZ2.y + theXYZ3.y;
0390     z = theA1 * theXYZ1.z + theA2 * theXYZ2.z + theXYZ3.z;
0391   }
0392 
0393   //! <me> is set to the following linear form :
0394   //! @code
0395   //! theA1 * theXYZ1 + theA2 * theXYZ2
0396   //! @endcode
0397   void SetLinearForm (const Standard_Real theA1, const gp_XYZ& theXYZ1,
0398                       const Standard_Real theA2, const gp_XYZ& theXYZ2)
0399   {
0400     x = theA1 * theXYZ1.x + theA2 * theXYZ2.x;
0401     y = theA1 * theXYZ1.y + theA2 * theXYZ2.y;
0402     z = theA1 * theXYZ1.z + theA2 * theXYZ2.z;
0403   }
0404 
0405   //! <me> is set to the following linear form :
0406   //! @code
0407   //! theA1 * theXYZ1 + theXYZ2
0408   //! @endcode
0409   void SetLinearForm (const Standard_Real theA1, const gp_XYZ& theXYZ1,
0410                       const gp_XYZ& theXYZ2)
0411   {
0412     x = theA1 * theXYZ1.x + theXYZ2.x;
0413     y = theA1 * theXYZ1.y + theXYZ2.y;
0414     z = theA1 * theXYZ1.z + theXYZ2.z;
0415   }
0416 
0417   //! <me> is set to the following linear form :
0418   //! @code
0419   //! theXYZ1 + theXYZ2
0420   //! @endcode
0421   void SetLinearForm (const gp_XYZ& theXYZ1, const gp_XYZ& theXYZ2)
0422   {
0423     x = theXYZ1.x + theXYZ2.x;
0424     y = theXYZ1.y + theXYZ2.y;
0425     z = theXYZ1.z + theXYZ2.z;
0426   }
0427 
0428   //! Dumps the content of me into the stream
0429   Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0430 
0431   //! Inits the content of me from the stream
0432   Standard_EXPORT Standard_Boolean InitFromJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos);
0433 
0434 private:
0435 
0436   Standard_Real x;
0437   Standard_Real y;
0438   Standard_Real z;
0439 
0440 };
0441 
0442 //=======================================================================
0443 //function : Cross
0444 // purpose :
0445 //=======================================================================
0446 inline void gp_XYZ::Cross (const gp_XYZ& theRight)
0447 {
0448   Standard_Real aXresult = y * theRight.z - z * theRight.y;
0449   Standard_Real aYresult = z * theRight.x - x * theRight.z;
0450   z = x * theRight.y - y * theRight.x;
0451   x = aXresult;
0452   y = aYresult;
0453 }
0454 
0455 //=======================================================================
0456 //function : CrossMagnitude
0457 // purpose :
0458 //=======================================================================
0459 inline Standard_Real gp_XYZ::CrossMagnitude (const gp_XYZ& theRight) const
0460 {
0461   Standard_Real aXresult = y * theRight.z - z * theRight.y;
0462   Standard_Real aYresult = z * theRight.x - x * theRight.z;
0463   Standard_Real aZresult = x * theRight.y - y * theRight.x;
0464   return sqrt (aXresult * aXresult + aYresult * aYresult + aZresult * aZresult);
0465 }
0466 
0467 //=======================================================================
0468 //function : CrossSquareMagnitude
0469 // purpose :
0470 //=======================================================================
0471 inline Standard_Real gp_XYZ::CrossSquareMagnitude (const gp_XYZ& theRight) const
0472 {
0473   Standard_Real aXresult = y * theRight.z - z * theRight.y;
0474   Standard_Real aYresult = z * theRight.x - x * theRight.z;
0475   Standard_Real aZresult = x * theRight.y - y * theRight.x;
0476   return aXresult * aXresult + aYresult * aYresult + aZresult * aZresult;
0477 }
0478 
0479 //=======================================================================
0480 //function : CrossCross
0481 // purpose :
0482 //=======================================================================
0483 inline void gp_XYZ::CrossCross (const gp_XYZ& theCoord1, const gp_XYZ& theCoord2)
0484 {
0485   Standard_Real aXresult = y * (theCoord1.x * theCoord2.y - theCoord1.y * theCoord2.x) -
0486                            z * (theCoord1.z * theCoord2.x - theCoord1.x * theCoord2.z);
0487   Standard_Real anYresult = z * (theCoord1.y * theCoord2.z - theCoord1.z * theCoord2.y) -
0488                             x * (theCoord1.x * theCoord2.y - theCoord1.y * theCoord2.x);
0489   z = x * (theCoord1.z * theCoord2.x - theCoord1.x * theCoord2.z) -
0490       y * (theCoord1.y * theCoord2.z - theCoord1.z * theCoord2.y);
0491   x = aXresult;
0492   y = anYresult;
0493 }
0494 
0495 //=======================================================================
0496 //function : DotCross
0497 // purpose :
0498 //=======================================================================
0499 inline Standard_Real gp_XYZ::DotCross (const gp_XYZ& theCoord1, const gp_XYZ& theCoord2) const
0500 {
0501   Standard_Real aXresult = theCoord1.y * theCoord2.z - theCoord1.z * theCoord2.y;
0502   Standard_Real anYresult = theCoord1.z * theCoord2.x - theCoord1.x * theCoord2.z;
0503   Standard_Real aZresult = theCoord1.x * theCoord2.y - theCoord1.y * theCoord2.x;
0504   return (x * aXresult + y * anYresult + z * aZresult);
0505 }
0506 
0507 //=======================================================================
0508 //function : Multiply
0509 // purpose :
0510 //=======================================================================
0511 inline void gp_XYZ::Multiply (const gp_Mat& theMatrix)
0512 {
0513   Standard_Real aXresult = theMatrix.Value (1, 1) * x + theMatrix.Value (1, 2) * y + theMatrix.Value (1, 3) * z;
0514   Standard_Real anYresult = theMatrix.Value (2, 1) * x + theMatrix.Value (2, 2) * y + theMatrix.Value (2, 3) * z;
0515   z = theMatrix.Value (3, 1) * x + theMatrix.Value (3, 2) * y + theMatrix.Value (3, 3) * z;
0516   x = aXresult;
0517   y = anYresult;
0518 }
0519 
0520 //=======================================================================
0521 //function : Normalize
0522 // purpose :
0523 //=======================================================================
0524 inline void gp_XYZ::Normalize()
0525 {
0526   Standard_Real aD = Modulus();
0527   Standard_ConstructionError_Raise_if (aD <= gp::Resolution(), "gp_XYZ::Normalize() - vector has zero norm");
0528   x = x / aD;
0529   y = y / aD;
0530   z = z / aD;
0531 }
0532 
0533 //=======================================================================
0534 //function : operator*
0535 // purpose :
0536 //=======================================================================
0537 inline gp_XYZ operator* (const gp_Mat& theMatrix, const gp_XYZ& theCoord1)
0538 {
0539   return theCoord1.Multiplied (theMatrix);
0540 }
0541 
0542 //=======================================================================
0543 //function : operator*
0544 // purpose :
0545 //=======================================================================
0546 inline gp_XYZ operator* (const Standard_Real theScalar, const gp_XYZ& theCoord1)
0547 {
0548   return theCoord1.Multiplied (theScalar);
0549 }
0550 
0551 #endif // _gp_XYZ_HeaderFile