# doc-cache created by Octave 5.1.0
# name: cache
# type: cell
# rows: 3
# columns: 156
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
Contents


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13943
 GEOM3D Geometry 3D Toolbox
 Version 1.22 06-Jun-2018 .

   Creation, transformations, algorithms and visualization of geometrical
   3D primitives, such as points, lines, planes, polyhedra, circles and
   spheres.
   
   Euler Angles are defined as follow:
   PHI is the azimut, i.e. the angle of the projection on horizontal plane
   with the Ox axis, with value beween 0 and 180 degrees.
   THETA is the latitude, i.e. the angle with the Oz axis, with value
   between -90 and +90 degrees.
   PSI is the 'roll', i.e. the rotation around the (PHI, THETA) direction,
   with value in degrees
   See also the 'angles3d' page.

   Base format for primitives:
   Point:      [x0 y0 z0]
   Vector:     [dx dy dz]
   Line:       [x0 y0 z0 dx dy dz]
   Edge:       [x1 y1 z1 x2 y2 z2]
   Plane:      [x0 y0 z0 dx1 dy1 dz1 dx2 dy2 dz2]
   Sphere:     [x0 y0 z0 R]
   Circle:     [x0 y0 z0 R PHI THETA PSI] (origin+center+normal+'roll').
   Ellipsoid:  [x0 y0 z0 A B C PHI THETA PSI]
   Cylinder:   [X1 Y1 Z1 X2 Y2 Z2 R]
   Box:        [xmin xmax ymin ymax zmin zmax]. Used for clipping shapes.
   
   Polygons are represented by N-by-3 array of points, the last point is
   not necessarily the same as the first one. Points must be coplanar.


 3D Points
   points3d                    - Description of functions operating on 3D points.
   midPoint3d                  - Middle point of two 3D points or of a 3D edge.
   isCoplanar                  - Tests input points for coplanarity in 3-space.
   transformPoint3d            - Transform a point with a 3D affine transform.
   distancePoints3d            - Compute euclidean distance between pairs of 3D Points.
   clipPoints3d                - Clip a set of points by a box or other 3d shapes.
   drawPoint3d                 - Draw 3D point on the current axis.

 3D Vectors
   vectors3d                   - Description of functions operating on 3D vectors.
   transformVector3d           - Transform a vector with a 3D affine transform.
   normalizeVector3d           - Normalize a 3D vector to have norm equal to 1.
   vectorNorm3d                - Norm of a 3D vector or of set of 3D vectors.
   hypot3                      - Diagonal length of a cuboidal 3D box .
   crossProduct3d              - Vector cross product faster than inbuilt MATLAB cross.
   vectorAngle3d               - Angle between two 3D vectors.
   isParallel3d                - Check parallelism of two 3D vectors.
   isPerpendicular3d           - Check orthogonality of two 3D vectors.
   drawVector3d                - Draw vector at a given position.

 Angles
   angles3d                    - Conventions for manipulating angles in 3D.
   anglePoints3d               - Compute angle between three 3D points.
   sphericalAngle              - Compute angle between points on the sphere.
   angleSort3d                 - Sort 3D coplanar points according to their angles in plane.
   randomAngle3d               - Return a 3D angle uniformly distributed on unit sphere.

 Coordinate transforms
   sph2cart2                   - Convert spherical coordinates to cartesian coordinates.
   cart2sph2                   - Convert cartesian coordinates to spherical coordinates.
   cart2sph2d                  - Convert cartesian coordinates to spherical coordinates in degrees.
   sph2cart2d                  - Convert spherical coordinates to cartesian coordinates in degrees.
   cart2cyl                    - Convert cartesian to cylindrical coordinates.
   cyl2cart                    - Convert cylindrical to cartesian coordinates.

 3D Lines and Edges
   lines3d                     - Description of functions operating on 3D lines.
   edges3d                     - Description of functions operating on 3D edges.
   createLine3d                - Create a line with various inputs.
   createEdge3d                - Create an edge between two 3D points, or from a 3D line.
   fitLine3d                   - Fit a 3D line to a set of points.
   parallelLine3d              - Create 3D line parallel to another one.
   projPointOnLine3d           - Project a 3D point orthogonally onto a 3D line.
   distancePointLine3d         - Euclidean distance between 3D point and line.
   isPointOnLine3d             - Test if a 3D point belongs to a 3D line.
   distancePointEdge3d         - Minimum distance between a 3D point and a 3D edge.
   linePosition3d              - Return the position of a 3D point projected on a 3D line.
   distanceLines3d             - Minimal distance between two 3D lines.
   transformLine3d             - Transform a 3D line with a 3D affine transform.
   reverseLine3d               - Return same 3D line but with opposite orientation.
   midPoint3d                  - Middle point of two 3D points or of a 3D edge.
   edgeLength3d                - Return the length of a 3D edge.
   clipEdge3d                  - Clip a 3D edge with a cuboid box.
   lineToEdge3d                - Convert a 3D straight line to a 3D finite edge.
   edgeToLine3d                - Convert a 3D edge to a 3D straight line.
   clipLine3d                  - Clip a line with a box and return an edge.
   drawEdge3d                  - Draw 3D edge in the current axes.
   drawLine3d                  - Draw a 3D line clipped by the current axes.

 Planes
   planes3d                    - Description of functions operating on 3D planes.
   createPlane                 - Create a plane in parametrized form.
   fitPlane                    - Fit a 3D plane to a set of points.
   normalizePlane              - Normalize parametric representation of a plane.
   parallelPlane               - Parallel to a plane through a point or at a given distance.
   reversePlane                - Return same 3D plane but with opposite orientation.
   isPlane                     - Check if input is a plane.
   transformPlane3d            - Transform a 3D plane with a 3D affine transform.
   planesBisector              - Bisector plane between two other planes.
   projPointOnPlane            - Return the orthogonal projection of a point on a plane.
   intersectPlanes             - Return intersection line between 2 planes in space.
   intersectThreePlanes        - Return intersection point between 3 planes in space.
   intersectLinePlane          - Intersection point between a 3D line and a plane.
   intersectEdgePlane          - Return intersection point between a plane and a edge.
   distancePointPlane          - Signed distance betwen 3D point and plane.
   projLineOnPlane             - Return the orthogonal projection of a line on a plane.
   isBelowPlane                - Test whether a point is below or above a plane.
   medianPlane                 - Create a plane in the middle of 2 points.
   planeNormal                 - Compute the normal to a plane.
   planePosition               - Compute position of a point on a plane.
   planePoint                  - Compute 3D position of a point in a plane.
   dihedralAngle               - Compute dihedral angle between 2 planes.
   drawPlane3d                 - Draw a plane clipped by the current axes.

 3D Polygons and curves
   polygons3d                  - Description of functions operating on 3D polygons.
   polygonCentroid3d           - Centroid (or center of mass) of a polygon.
   polygonArea3d               - Area of a 3D polygon.
   polygon3dNormalAngle        - Normal angle at a vertex of the 3D polygon.
   intersectLinePolygon3d      - Intersection point of a 3D line and a 3D polygon.
   intersectRayPolygon3d       - Intersection point of a 3D ray and a 3D polygon.
   clipConvexPolygon3dHP       - Clip a convex 3D polygon with Half-space.
   drawPolygon3d               - Draw a 3D polygon specified by a list of vertex coords.
   drawPolyline3d              - Draw a 3D polyline specified by a list of vertex coords.
   fillPolygon3d               - Fill a 3D polygon specified by a list of vertex coords.

 3D Triangles
   triangleArea3d              - Area of a 3D triangle.
   distancePointTriangle3d     - Minimum distance between a 3D point and a 3D triangle.
   intersectLineTriangle3d     - Intersection point of a 3D line and a 3D triangle.

 3D circles and ellipses
   circles3d                   - Description of functions operating on 3D circles.
   fitCircle3d                 - Fit a 3D circle to a set of points.
   circle3dPosition            - Return the angular position of a point on a 3D circle.
   circle3dPoint               - Coordinates of a point on a 3D circle from its position.
   circle3dOrigin              - Return the first point of a 3D circle.
   drawCircle3d                - Draw a 3D circle.
   drawCircleArc3d             - Draw a 3D circle arc.
   drawEllipse3d               - Draw a 3D ellipse.

 Spheres
   spheres                     - Description of functions operating on 3D spheres.
   createSphere                - Create a sphere containing 4 points.
   intersectLineSphere         - Return intersection points between a line and a sphere.
   intersectPlaneSphere        - Return intersection circle between a plane and a sphere.
   drawSphere                  - Draw a sphere as a mesh.
   drawSphericalEdge           - Draw an edge on the surface of a sphere.
   drawSphericalTriangle       - Draw a triangle on a sphere.
   fillSphericalTriangle       - Fill a triangle on a sphere.
   drawSphericalPolygon        - Draw a spherical polygon.
   fillSphericalPolygon        - Fill a spherical polygon.
   sphericalVoronoiDomain      - Compute a spherical voronoi domain.

 Smooth surfaces
   equivalentEllipsoid         - Equivalent ellipsoid of a set of 3D points.
   fitEllipse3d                - Fit an ellipse to a set of points.
   ellipsoidSurfaceArea        - Approximated surface area of an ellipsoid.
   oblateSurfaceArea           - Approximated surface area of an oblate ellipsoid.
   prolateSurfaceArea          - Approximated surface area of a prolate ellipsoid.
   cylinderSurfaceArea         - Surface area of a cylinder.
   intersectLineCylinder       - Compute intersection points between a line and a cylinder.
   revolutionSurface           - Create a surface of revolution from a planar curve.
   surfaceCurvature            - Curvature on a surface from angle and principal curvatures.
   drawEllipsoid               - Draw a 3D ellipsoid.
   drawTorus                   - Draw a torus (3D ring).
   drawCylinder                - Draw a cylinder.
   drawEllipseCylinder         - Draw a cylinder with ellipse cross-section.
   drawSurfPatch               - Draw a 3D surface patch, with 2 parametrized surfaces.

 Bounding boxes management
   boxes3d                     - Description of functions operating on 3D boxes.
   boundingBox3d               - Bounding box of a set of 3D points.
   orientedBox3d               - Object-oriented bounding box of a set of 3D points.
   intersectBoxes3d            - Intersection of two 3D bounding boxes.
   mergeBoxes3d                - Merge 3D boxes, by computing their greatest extent.
   box3dVolume                 - Volume of a 3-dimensional box.
   randomPointInBox3d          - Generate random point(s) within a 3D box.
   drawBox3d                   - Draw a 3D box defined by coordinate extents.

 Geometric transforms
   transforms3d                - Conventions for manipulating 3D affine transforms.
   fitAffineTransform3d        - Fit an affine transform using two point sets.
   registerPoints3dAffine      - Fit 3D affine transform using iterative algorithm.
   createTranslation3d         - Create the 4x4 matrix of a 3D translation.
   createScaling3d             - Create the 4x4 matrix of a 3D scaling.
   createRotationOx            - Create the 4x4 matrix of a 3D rotation around x-axis.
   createRotationOy            - Create the 4x4 matrix of a 3D rotation around y-axis.
   createRotationOz            - Create the 4x4 matrix of a 3D rotation around z-axis.
   createBasisTransform3d      - Compute matrix for transforming a basis into another basis.
   eulerAnglesToRotation3d     - Convert 3D Euler angles to 3D rotation matrix.
   isTransform3d               - Check if input is a affine transformation matrix.
   rotation3dToEulerAngles     - Extract Euler angles from a rotation matrix.
   createRotation3dLineAngle   - Create rotation around a line by an angle theta.
   rotation3dAxisAndAngle      - Determine axis and angle of a 3D rotation matrix.
   createRotationVector3d      - Calculates the rotation between two vectors.
   createRotationVectorPoint3d - Calculates the rotation between two vectors.
   recenterTransform3d         - Change the fixed point of an affine 3D transform.
   composeTransforms3d         - Concatenate several space transformations.

 Various drawing Functions
   drawGrid3d                  - Draw a 3D grid on the current axis.
   drawAxis3d                  - Draw a coordinate system and an origin.
   drawAxisCube                - Draw a colored cube representing axis orientation.
   drawCube                    - Draw a 3D centered cube, eventually rotated.
   drawCuboid                  - Draw a 3D cuboid, eventually rotated.
   drawPlatform                - Draw a rectangular platform with a given size.
   drawLabels3d                - Draw text labels at specified 3D positions.


   Credits:
   * Several functions contributed by Sven Holcombe
   * function isCoplanar was originally written by Brett Shoelson.
   * Songbai Ji enhanced file intersectPlaneLine (6/23/2006).
   * several functions contributed by oqilipo


 ------
 Author: David Legland
 e-mail: david.legland@inra.fr
 Created: 2005-11-07
 Homepage: http://github.com/mattools/matGeom
 http://www.pfl-cepia.inra.fr/index.php?page=geom3d
 Copyright 2005 INRA



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
 GEOM3D Geometry 3D Toolbox
 Version 1.22 06-Jun-2018 .



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
anglePoints3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 496
ANGLEPOINTS3D Compute angle between three 3D points.

   ALPHA = anglePoints3d(P1, P2)
   Computes angle (P1, O, P2), in radians, between 0 and PI.

   ALPHA = anglePoints3d(P1, P2, P3)
   Computes angle (P1, P2, P3), in radians, between 0 and PI.

   ALPHA = anglePoints3d(PTS)
   PTS is a 3x3 or 2x3 array containing coordinate of points.

   See also
   points3d, angles3d

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 21/02/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
ANGLEPOINTS3D Compute angle between three 3D points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
angleSort3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 952
ANGLESORT3D Sort 3D coplanar points according to their angles in plane.

   PTS2 = angleSort3d(PTS);
   Considers all points are located on the same plane, and sort them
   according to the angle on plane. PTS is a [Nx2] array. Note that the
   result depend on plane orientation: points can be in reverse order
   compared to expected. The reference plane is computed besed on the 3
   first points.

   PTS2 = angleSort3d(PTS, PTS0);
   Computes angles between each point of PTS and PT0. By default, uses
   centroid of points.

   PTS2 = angleSort3d(PTS, PTS0, PTS1);
   Specifies the point which will be used as a start.

   [PTS2, I] = angleSort3d(...);
   Also return in I the indices of PTS, such that PTS2 = PTS(I, :);

   See also:
   points3d, angles3d, angleSort

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2005-11-24
 Copyright 2005 INRA - CEPIA Nantes - MIAJ (Jouy-en-Josas).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 71
ANGLESORT3D Sort 3D coplanar points according to their angles in plane.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
angles3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1685
ANGLES3D Conventions for manipulating angles in 3D.

   The library uses both radians and degrees angles;
   Results of angle computation between shapes usually returns angles in
   radians.
   Representation of 3D shapes use angles in degrees (easier to manipulate
   and to save). 

   Contrary to the plane, there are no oriented angles in 3D. Angles
   between lines or between planes are comprised between 0 and PI.

   Spherical angles
   Spherical angles are defined by 2 angles:
   * THETA, the colatitude, representing angle with Oz axis (between 0 and
       PI)
   * PHI, the azimut, representing angle with Ox axis of horizontal
       projection of the direction (between 0 and 2*PI)

   Spherical coordinates can be represented by THETA, PHI, and the
   distance RHO to the origin.

   Euler angles
   Some functions for creating rotations use Euler angles. They follow the
   ZYX convention in the global reference system, that is eqivalent to the
   XYZ convention ine a local reference system. 
   Euler angles are given by a triplet of angles [PHI THETA PSI] that
   represents the succession of 3 rotations: 
   * rotation around X by angle PSI    ("roll")
   * rotation around Y by angle THETA  ("pitch")
   * rotation around Z by angle PHI    ("yaw")

   In this library, euler angles are given in degrees. The functions that
   use euler angles use the keyword 'Euler' in their name.


   See also
   cart2sph2, sph2cart2, cart2sph2d, sph2cart2d
   anglePoints3d, angleSort3d, sphericalAngle, randomAngle3d
   dihedralAngle, polygon3dNormalAngle, eulerAnglesToRotation3d
   rotation3dAxisAndAngle, rotation3dToEulerAngles




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
ANGLES3D Conventions for manipulating angles in 3D.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
boundingBox3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 792
BOUNDINGBOX3D Bounding box of a set of 3D points.

   BOX = boundingBox3d(POINTS)
   Returns the bounding box of the set of points POINTS. POINTS is a
   N-by-3 array containing points coordinates. The result BOX is a 1-by-6 
   array, containing:
   [XMIN XMAX YMIN YMAX ZMIN ZMAX]

   Example
   % Draw bounding box of a cubeoctehedron
     [v e f] = createCubeOctahedron;
     box3d = boundingBox3d(v);
     figure; hold on;
     drawMesh(v, f);
     drawBox3d(box3d);
     set(gcf, 'renderer', 'opengl')
     axis([-2 2 -2 2 -2 2]);
     view(3)
     
   See also
   boxes3d, drawBox3d

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2011-04-01,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2011 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
BOUNDINGBOX3D Bounding box of a set of 3D points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
box3dVolume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 530
BOX3DVOLUME Volume of a 3-dimensional box.

   V = box3dVolume(BOX)

   A box is represented as a set of limits in each direction:
   BOX = [XMIN XMAX YMIN YMAX ZMIN ZMAX].

   Example
   [n e f] = createCubeOctahedron;
   box = boundingBox3d(n);
   vol = box3dVolume(box)
   vol = 
       8


   See also
   boxes3d, boundingBox3d

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2010-07-26,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
BOX3DVOLUME Volume of a 3-dimensional box.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
boxes3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 620
BOXES3D Description of functions operating on 3D boxes.

   A box defined by its coordinate extents: 
   BOX = [XMIN XMAX YMIN YMAX ZMIN ZMAX].

   Example
   % Draw a polyhedron together with its bounding box   
   [n e f]= createIcosahedron;
   drawPolyhedron(n, f);
   hold on;
   drawBox3d(point3dBounds(n))


   See also
   boundingBox3d, box3dVolume, drawBox3d
   intersectBoxes3d, mergeBoxes3d, randomPointInBox3d


 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2010-07-26,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
BOXES3D Description of functions operating on 3D boxes.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
cart2cyl


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 804
CART2CYL  Convert cartesian to cylindrical coordinates.

   CYL = cart2cyl(POINT)
   convert the 3D cartesian coordinates of points POINT (given by [X Y Z]
   where X, Y, Z have the same size) into cylindrical coordinates CYL,
   given by [THETA R Z]. 
   THETA is the arctangent of the ratio Y/X (between 0 and 2*PI)
   R     can be computed using sqrt(X^2+Y^2)
   Z     keeps the same value.
   The size of THETA, and R is the same as the size of X, Y and Z.

   CYL = cart2cyl(X, Y, Z)
   provides coordinates as 3 different parameters

   Example
   cart2cyl([-1 0 2])
   gives : 4.7124    1.0000     2.0000

   See also agles3d, cart2pol, cart2sph2


 ------
 Author: David Legland
 e-mail: david.legland@jouy.inra.fr
 Created: 2006-03-23
 Copyright 2006 INRA - CEPIA Nantes - MIAJ (Jouy-en-Josas).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
CART2CYL  Convert cartesian to cylindrical coordinates.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
cart2sph2


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 808
CART2SPH2 Convert cartesian coordinates to spherical coordinates.

   [THETA PHI RHO] = cart2sph2([X Y Z])
   [THETA PHI RHO] = cart2sph2(X, Y, Z)

   The following convention is used:
   THETA is the colatitude, in radians, 0 for north pole, +pi for south
   pole, pi/2 for points with z=0. 
   PHI is the azimuth, in radians, defined as matlab cart2sph: angle from
   Ox axis, counted counter-clockwise.
   RHO is the distance of the point to the origin.
   Discussion on choice for convention can be found at:
   http://www.physics.oregonstate.edu/bridge/papers/spherical.pdf

   Example:
   cart2sph2([1 0 0])  returns [pi/2 0 1];
   cart2sph2([1 1 0])  returns [pi/2 pi/4 sqrt(2)];
   cart2sph2([0 0 1])  returns [0 0 1];

   See also:
   angles3d, sph2cart2, cart2sph, cart2sph2d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
CART2SPH2 Convert cartesian coordinates to spherical coordinates.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
cart2sph2d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1061
CART2SPH2D Convert cartesian coordinates to spherical coordinates in degrees.

   [THETA PHI RHO] = cart2sph2d([X Y Z])
   [THETA PHI RHO] = cart2sph2d(X, Y, Z)

   The following convention is used:
   THETA is the colatitude, in degrees, 0 for north pole, 180 degrees for
   south pole, 90 degrees for points with z=0.
   PHI is the azimuth, in degrees, defined as matlab cart2sph: angle from
   Ox axis, counted counter-clockwise.
   RHO is the distance of the point to the origin.
   Discussion on choice for convention can be found at:
   http://www.physics.oregonstate.edu/bridge/papers/spherical.pdf

   Example:
     cart2sph2d([1 0 0])
     ans =
       90   0   1

     cart2sph2d([1 1 0])
     ans =
       90   45   1.4142

     cart2sph2d([0 0 1])
     ans =
       0    0    1


   See also:
   angles3d, sph2cart2d, cart2sph, cart2sph2

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2011-06-29,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2011 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 77
CART2SPH2D Convert cartesian coordinates to spherical coordinates in degrees.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
circle3dOrigin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 413
CIRCLE3DORIGIN Return the first point of a 3D circle.

   P = circle3dOrigin([XC YC ZC R THETA PHI])
   P = circle3dOrigin([XC YC ZC R THETA PHI PSI])
   Returns the origin point of the circle, i.e. the first point used for
   drawing circle.

   See also:
   circles3d, points3d, circle3dPosition

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 21/02/2005




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
CIRCLE3DORIGIN Return the first point of a 3D circle.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
circle3dPoint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 781
CIRCLE3DPOINT Coordinates of a point on a 3D circle from its position.

   output = circle3dPoint(input)

   Example
   % Draw some points on a 3D circle
     figure('color','w'); hold on; view(130,-10);
     circle = [10 20 30 50 90 45 0];
     drawCircle3d(circle)
     % origin point
     pos1 = 0;
     drawPoint3d(circle3dPoint(circle, pos1), 'ro')
     % few points regularly spaced
     drawPoint3d(circle3dPoint(circle, 10:10:40), '+')
     % Draw point opposite to origin
     drawPoint3d(circle3dPoint(circle, 180), 'k*')
   

   See also
   circles3d, circle3dPosition

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2011-06-21,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2011 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
CIRCLE3DPOINT Coordinates of a point on a 3D circle from its position.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
circle3dPosition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 521
CIRCLE3DPOSITION Return the angular position of a point on a 3D circle.

   POS = circle3dPosition(POINT, CIRCLE)
   Returns angular position of point on the circle, in degrees, between 0
   and 360.
   with POINT: [xp yp zp]
   and CIRCLE: [X0 Y0 Z0 R THETA PHI] or [X0 Y0 Z0 R THETA PHI PSI]
   (THETA being the colatitude, and PHI the azimut)

   See also:
   circles3d, circle3dOrigin, circle3dPoint

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 21/02/2005




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 71
CIRCLE3DPOSITION Return the angular position of a point on a 3D circle.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
circles3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 863
CIRCLES3D Description of functions operating on 3D circles.

   Circles are represented by a center, a radius and a 3D angle
   representing the normal of the plane containing the circle. 
   C = [xc yc zc R theta phi psi].
   THETA is the colatitude of the normal, in degrees, between 0 and 180
   PHI is the azimut of the normal, in degrees, between 0 and 360
   PSI is the proper rotation of the circle around the normal, between 0
       and 360 degrees
   The parameter PSI is used to locate a point on the 3D circle.

   See also
   circle3dOrigin, circle3dPosition, circle3dPoint, intersectPlaneSphere
   drawCircle3d, drawCircleArc3d, drawEllipse3d

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2008-10-13,    using Matlab 7.4.0.287 (R2007a)
 Copyright 2008 INRA - BIA PV Nantes - MIAJ Jouy-en-Josas.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
CIRCLES3D Description of functions operating on 3D circles.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
clipConvexPolygon3dHP


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 636
CLIPCONVEXPOLYGON3DHP Clip a convex 3D polygon with Half-space.

   POLY2 = clipConvexPolygon3dHP(POLY, PLANE)
   POLY is a N-by-3 array of points, and PLANE is given as:
   [x0 y0 z0 dx1 dy1 dz1 dx2 dy2 dz2].
   The result POLY2 is also an array of 3d points, sometimes smaller than
   poly, and that can be 0-by-3 (empty polygon).

   POLY2 = clipConvexPolygon3dHP(POLY, PT0, NORMAL)
   uses plane with normal NORMAL and containing point PT0.


   See also:
   polygons3d, polyhedra

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2007-01-05
 Copyright 2007 INRA - BIA PV Nantes - MIAJ Jouy-en-Josas.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
CLIPCONVEXPOLYGON3DHP Clip a convex 3D polygon with Half-space.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
clipEdge3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 154
CLIPEDGE3D Clip a 3D edge with a cuboid box.

   CLIPPED = clipEdge3d(EDGE, BOX)

   Example
   clipEdge3d

   See also
     lines3d, edges3d, clipLine3d



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
CLIPEDGE3D Clip a 3D edge with a cuboid box.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
clipLine3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 472
CLIPLINE3D Clip a line with a box and return an edge.

   EDGE = clipLine3d(LINE, BOX);
   Clips the line LINE with the bounds given in BOX, and returns the
   corresponding edge. 

   If the line lies totally outside of the box, returns a 1-by-6 row array
   containing only NaN's.

   If LINE is a N-by-6 array, with one line by row, returns the clipped
   edge coresponding to each line in a N-by-6 array.

   See also:
   lines3d, edges3d, createLine3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
CLIPLINE3D Clip a line with a box and return an edge.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
clipPoints3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 581
CLIPPOINTS3D Clip a set of points by a box or other 3d shapes.

   CLIP = clipPoints3d(POINTS, BOX);
   Returns the set of points which are located inside of the box BOX.

   [CLIP, IND] = clipPoints3d(POINTS, BOX);
   Also returns the indices of clipped points.
   
   ... = clipPoints3d(..., 'shape', 'sphere') Specify the shape.
   Default is 'box'. But it is also possible to use 'sphere' or 'plane'.
   
   ... = clipPoints3d(..., 'inside', false) returns the set of  
   points outside the shape instead of inside.

   See also
   points3d, boxes3d, spheres




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
CLIPPOINTS3D Clip a set of points by a box or other 3d shapes.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
clipPolygon3dHP


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1029
CLIPPOLYGON3DHP clip a 3D polygon with Half-space.

   usage
   POLY2 = clipPolygon3dHP(POLY, PLANE)
   POLY is a [Nx3] array of points, and PLANE is given as :
   [x0 y0 z0 dx1 dy1 dz1 dx2 dy2 dz2].
   The result POLY2 is also an array of 3d points, sometimes smaller than
   poly, and that can be [0x3] (empty polygon).

   POLY2 = clipPolygon3dHP(POLY, PT0, NORMAL)
   uses plane with normal NORMAL and containing point PT0.

   TODO: not yet implemented

   There is a problem for non-convex polygons, as they can be clipped in
   several polygons. Possible solutions:
   * create another function 'clipConvexPolygon3dPlane' or
       'clipConvexPolygon3d', using a simplified algorithm
   * returns a list of polygons instead of a single polygon,
   * in the case of one polygon as return decide what to return
   * and rename this function to 'clipPolygon3d'

   See also:
   poygons3d, polyhedra, clipConvexPolygon3dHP

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 02/08/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
CLIPPOLYGON3DHP clip a 3D polygon with Half-space.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
composeTransforms3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 757
COMPOSETRANSFORMS3D Concatenate several space transformations.

   TRANS = composeTransforms3d(TRANS1, TRANS2, ...);
   Computes the affine transform equivalent to performing successively
   TRANS1, TRANS2, ...
   
   Example:
   PTS  = rand(20, 3);
   ROT1 = createRotationOx(pi/3);
   ROT2 = createRotationOy(pi/4);
   ROT3 = createRotationOz(pi/5);
   ROTS = composeTransforms3d(ROT1, ROT2, ROT3);
   Then:
   PTS2 = transformPoint3d(PTS, ROTS);
   will give the same result as:
   PTS3 = transformPoint3d(transformPoint3d(transformPoint3d(PTS, ...
       ROT1), ROT2), ROT3);

   See also:
   transforms3d, transformPoint3d

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 29/29/2006.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
COMPOSETRANSFORMS3D Concatenate several space transformations.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
createBasisTransform3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1269
CREATEBASISTRANSFORM3D Compute matrix for transforming a basis into another basis.

   TRANSFO = createBasisTransform3d(SOURCE, TARGET) will create a 4-by-4
   transformation matrix representing the transformation from SOURCE basis
   to TARGET basis. 
    SOURCE and TARGET are either standard 1-by-9 geom3d PLANE
    representations of the form: [x0 y0 z0  ex1 ey1 ez1  ex2 ey2 ez2]
     OR
    SOURCE and TARGET may be any string such as 'global' or 'g' in which
    case they represent the global plane [0 0 0 1 0 0 0 1 0].

   The resulting TRANSFO matrix is such that a point expressed with
   coordinates of the first basis will be represented by new coordinates
   P2 = transformPoint3d(P1, TRANSFO) in the target basis.

   Either (or both) SOURCE or TARGET may be an N-by-9 set of N planes. In
   that case, TRANSFO will be a 4-by-4-by-N array of N transformation
   matrices.

   Example:
     % Calculate local plane coords. of a point given in global coords
     Plane = [10 10 10  1 0 0  0 1 0];
     Tform = createBasisTransform3d('global', Plane);
     PT_IN_PLANE = transformPoint3d([3 8 2], Tform)
     PT_IN_PLANE =
         13  18  12

   See also
     transforms3d, transformPoint3d, planePosition, createBasisTransform



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
CREATEBASISTRANSFORM3D Compute matrix for transforming a basis into another b...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
createEdge3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 473
CREATEEDGE3D Create an edge between two 3D points, or from a 3D line.

   E = createEdge3d(P1, P2)
   Creates the 3D edge joining the two points P1 and P2.

   E = createEdge3d(LIN)
   Creates the 3D edge with same origin and same direction vector as the
   3D line LIN.

   Example
     p1 = [1 1 1];
     p2 = [3 4 5];
     edge = createEdge3d(p1, p2);
     edgeLength3d(edge)
     ans =
         5.3852
   
   See also
     edges3d, drawEdge3d, clipEdge3d, edgelength3d



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
CREATEEDGE3D Create an edge between two 3D points, or from a 3D line.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
createLine3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1130
CREATELINE3D Create a line with various inputs.

   Line is represented in a parametric form : [x0 y0 z0 dx dy dz]
       x = x0 + t*dx
       y = y0 + t*dy;
       z = z0 + t*dz;


   L = createLine3d(P1, P2);
   Returns the line going through the two given points P1 and P2.
   
   L = createLine3d(X0, Y0, Z0, DX, DY, DZ);
   Returns the line going through the point [x0, y0, z0], and with
   direction vector given by [DX DY DZ]. 

   L = createLine3d(P0, DX, DY, DZ);
   Returns the line going through point P0 given by [x0, y0, z0] and with
   direction vector given by [DX DY DZ]. 

   L = createLine3d(THETA, PHI);
   Create a line originated at (0,0) and with angles theta and phi.

   L = createLine3d(P0, THETA, PHI);
   Create a line with direction given by theta and phi, and which contains
   point P0. 


   Note : in all cases, parameters can be vertical arrays of the same
   dimension. The result is then an array of lines, of dimensions [N*6].

   See also:
   lines3d

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 17/02/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
CREATELINE3D Create a line with various inputs.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
createPlane


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1390
CREATEPLANE Create a plane in parametrized form.

   PLANE = createPlane(P1, P2, P3) 
   creates a plane containing the 3 points

   PLANE = createPlane(PTS) 
   The 3 points are packed into a single 3x3 array.

   PLANE = createPlane(P0, N);
   Creates a plane from a point and from a normal to the plane. The
   parameter N is given either as a 3D vector (1-by-3 row vector), or as
   [THETA PHI], where THETA is the colatitute (angle with the vertical
   axis) and PHI is angle with Ox axis, counted counter-clockwise (both
   given in radians).
 
   PLANE = createPlane(P0, Dip, DipDir);
   Creates a plane from a point and from a dip and dip direction angles 
   of the plane. Parameters Dip and DipDir angles are given as numbers.
   Dip : maximum inclination to the horizontal.
   DipDir : direction of the horizontal trace of the line of dip, 
            measured clockwise from north.

   The created plane data has the following format:
   PLANE = [X0 Y0 Z0  DX1 DY1 DZ1  DX2 DY2 DZ2], with
   - (X0, Y0, Z0) is a point belonging to the plane
   - (DX1, DY1, DZ1) is a first direction vector
   - (DX2, DY2, DZ2) is a second direction vector
   The 2 direction vectors are normalized and orthogonal.

   See also:
   planes3d, medianPlane
   
   ---------
   author: David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 18/02/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
CREATEPLANE Create a plane in parametrized form.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
createRotation3dLineAngle


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 506
CREATEROTATION3DLINEANGLE Create rotation around a line by an angle theta.

   MAT = createRotation3dLineAngle(LINE, ANGLE)

   Example
     origin = [1 2 3];
     direction = [4 5 6];
     line = [origin direction];
     angle = pi/3;
     rot = createRotation3dLineAngle(line, angle);
     [axis angle2] = rotation3dAxisAndAngle(rot);
     angle2
     angle2 =
           1.0472

   See also
   transforms3d, rotation3dAxisAndAngle, rotation3dToEulerAngles,
   eulerAnglesToRotation3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 74
CREATEROTATION3DLINEANGLE Create rotation around a line by an angle theta.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
createRotationOx


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 833
CREATEROTATIONOX Create the 4x4 matrix of a 3D rotation around x-axis.

   TRANS = createRotationOx(THETA);
   Returns the transform matrix corresponding to a rotation by the angle
   THETA (in radians) around the Ox axis. A rotation by an angle of PI/2
   would transform the vector [0 1 0] into the vector [0 0 1].

   The returned matrix has the form:
   [1      0            0      0]
   [0  cos(THETA) -sin(THETA)  0]
   [0  sin(THETA)  cos(THETA)  0]
   [0      0            0      1]

   TRANS = createRotationOx(ORIGIN, THETA);
   TRANS = createRotationOx(X0, Y0, Z0, THETA);
   Also specifies origin of rotation. The result is similar as performing
   translation(-X0, -Y0, -Z0), rotation, and translation(X0, Y0, Z0).

   See also:
   transforms3d, transformPoint3d, createRotationOy, createRotationOz




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
CREATEROTATIONOX Create the 4x4 matrix of a 3D rotation around x-axis.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
createRotationOy


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 822
CREATEROTATIONOY Create the 4x4 matrix of a 3D rotation around y-axis.

   TRANS = createRotationOy(THETA);
   Returns the transform matrix corresponding to a rotation by the angle
   THETA (in radians) around the Oy axis. A rotation by an angle of PI/2
   would transform the vector [0 0 1] into the vector [1 0 0].

   The returned matrix has the form:
   [ cos(THETA)  0  sin(THETA)  0 ]
   [    0        1       0      0 ]
   [-sin(THETA)  0  cos(THETA)  0 ]
   [    0        0       0      1 ]

   TRANS = createRotationOy(ORIGIN, THETA);
   TRANS = createRotationOy(X0, Y0, Z0, THETA);
   Also specifies origin of rotation. The result is similar as performing
   translation(-X0, -Y0, -Z0), rotation, and translation(X0, Y0, Z0).


   See also:
   transforms3d, transformPoint3d, createRotationOx, createRotationOz




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
CREATEROTATIONOY Create the 4x4 matrix of a 3D rotation around y-axis.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
createRotationOz


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 835
CREATEROTATIONOZ Create the 4x4 matrix of a 3D rotation around z-axis.

   TRANS = createRotationOz(THETA);
   Returns the transform matrix corresponding to a rotation by the angle
   THETA (in radians) around the Oz axis. A rotation by an angle of PI/2
   would transform the vector [1 0 0] into the vector [0 1 0].

   The returned matrix has the form:
   [cos(THETA) -sin(THETA)  0  0]
   [sin(THETA)  cos(THETA)  0  0]
   [    0           0       1  0]
   [    0           0       0  1]

   TRANS = createRotationOz(ORIGIN, THETA);
   TRANS = createRotationOz(X0, Y0, Z0, THETA);
   Also specifies origin of rotation. The result is similar as performing
   translation(-X0, -Y0, -Z0), rotation, and translation(X0, Y0, Z0).


   See also:
   transforms3d, transformPoint3d, createRotationOx, createRotationOy




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
CREATEROTATIONOZ Create the 4x4 matrix of a 3D rotation around z-axis.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
createRotationVector3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 691
CREATEROTATIONVECTOR3D Calculates the rotation between two vectors.

   ROT = createRotationVector3d(A, B) returns the 4x4 rotation matrix ROT
   to transform vector A in the same direction as vector B.

   Example
     A=[ .1  .2  .3];
     B=-1+2.*rand(1,3);
     ROT = createRotationVector3d(A,B);
     C = transformVector3d(A,ROT);
     figure('color','w'); hold on; view(3)
     O=[0 0 0];
     drawVector3d(O, A,'r');
     drawVector3d(O, B,'g');
     drawVector3d(O, C,'r');

   See also
   transformPoint3d, createRotationOx, createRotationOy, createRotationOz

   Source
     https://math.stackexchange.com/a/897677

 ---------
 Author: oqilipo
 Created: 2017-08-07
 Copyright 2017



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 67
CREATEROTATIONVECTOR3D Calculates the rotation between two vectors.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
createRotationVectorPoint3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 686
CREATEROTATIONVECTORPOINT3D Calculates the rotation between two vectors.
   around a point
   
   TFM = createRotationVectorPoint3d(A,B,P) returns the transformation 
   to rotate the vector A in the direction of vector B around point P
   
   Example
     A=-5+10.*rand(1,3);
     B=-10+20.*rand(1,3);
     P=-50+100.*rand(1,3);
     ROT = createRotationVectorPoint3d(A,B,P);
     C = transformVector3d(A,ROT);
     figure('color','w'); hold on; view(3)
     drawPoint3d(P,'k')
     drawVector3d(P, A,'r')
     drawVector3d(P, B,'g')
     drawVector3d(P, C,'r')

   See also
   transformPoint3d, createRotationVector3d

 ---------
 Author: oqilipo
 Created: 2017-08-07
 Copyright 2017



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
CREATEROTATIONVECTORPOINT3D Calculates the rotation between two vectors.
   a...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
createScaling3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 679
CREATESCALING3D Create the 4x4 matrix of a 3D scaling.

   TRANS = createScaling3d(S);
   returns the scaling transform corresponding to a scaling factor S in
   each direction. S can be a scalar, or a 1-by-3 vector containing the
   scaling factor in each direction.

   TRANS = createScaling3d(SX, SY, SZ);
   returns the scaling transform corresponding to a different scaling
   factor in each direction.

   The returned matrix has the form :
   [SX  0  0  0]
   [ 0 SY  0  0]
   [ 0  0 SZ  0]
   [ 0  0  0  0]

   See also:
   transforms3d, transformPoint3d, transformVector3d, createTranslation3d,
   createRotationOx, createRotationOy, createRotationOz



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
CREATESCALING3D Create the 4x4 matrix of a 3D scaling.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
createSphere


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 389
CREATESPHERE Create a sphere containing 4 points.

   s = createSphere(p1, p2, p3, p4);
   return in s the sphere common to the 4 pointsp1, p2, p3 and p4.

   Ref: P. Bourke
   http://astronomy.swin.edu.au/~pbourke/geometry/spherefrom4/

   See also
   spheres, circles3d

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 22/03/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
CREATESPHERE Create a sphere containing 4 points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
createTranslation3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 644
CREATETRANSLATION3D Create the 4x4 matrix of a 3D translation.

   usage:
   TRANS = createTranslation3d(DX, DY, DZ);
   return the translation corresponding to DX and DY.
   The returned matrix has the form :
   [1 0 0 DX]
   [0 1 0 DY]
   [0 0 1 DZ]
   [0 0 0  1]

   TRANS = createTranslation3d(VECT);
   return the translation corresponding to the given vector [x y z].


   See also:
   transforms3d, transformPoint3d, transformVector3d, 
   createRotationOx, createRotationOy, createRotationOz, createScaling3d

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 06/04/2004.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
CREATETRANSLATION3D Create the 4x4 matrix of a 3D translation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
crossProduct3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 578
CROSSPRODUCT3D Vector cross product faster than inbuilt MATLAB cross.

   C = crossProduct3d(A, B) 
   returns the cross product of the two 3D vectors A and B, that is: 
       C = A x B
   A and B must be N-by-3 element vectors. If either A or B is a 1-by-3
   row vector, the result C will have the size of the other input and will
   be the  concatenation of each row's cross product. 

   Example
     v1 = [2 0 0];
     v2 = [0 3 0];
     crossProduct3d(v1, v2)
     ans =
         0   0   6


   Class support for inputs A,B:
      float: double, single

   See also DOT.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
CROSSPRODUCT3D Vector cross product faster than inbuilt MATLAB cross.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
cyl2cart


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 722
CYL2CART  Convert cylindrical to cartesian coordinates.

   CART = cyl2cart(CYL)
   convert the 3D cylindrical coordinates of points CYL (given by 
   [THETA R Z] where THETA, R, and Z have the same size) into cartesian
   coordinates CART, given by [X Y Z]. 
   The transforms is the following :
   X = R*cos(THETA);
   Y = R*sin(THETA);
   Z remains inchanged.

   CART = cyl2cart(THETA, R, Z)
   provides coordinates as 3 different parameters

   Example
   cyl2cart([-1 0 2])
   gives : 4.7124    1.0000     2.0000

   See also angles3d, cart2pol, cart2sph2, cart2cyl


 ------
 Author: David Legland
 e-mail: david.legland@jouy.inra.fr
 Created: 2006-03-23
 Copyright 2006 INRA - CEPIA Nantes - MIAJ (Jouy-en-Josas).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
CYL2CART  Convert cylindrical to cartesian coordinates.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
cylinderSurfaceArea


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 580
CYLINDERSURFACEAREA  Surface area of a cylinder.

   S = cylinderSurfaceArea(CYL)
   Computes the surface area of the cylinder defined by:
   CYL = [X1 Y1 Z1  X2 Y2 Z2  R], 
   where [X1 Y1 Z1] and [X2 Y2 Z2] are the coordinates of the cylinder
   extremities, and R is the cylinder radius.
   The surface area of the cylinder comprises the surface area of the two
   disk-shape end caps.

   Example
     cyl = [0 0 0  1 0 0  1];
     cylinderSurfaceArea(cyl)
     ans =
        12.5664
     % equals to 4*pi

   See also
     geom3d, ellipsoidSurfaceArea, intersectLineCylinder



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
CYLINDERSURFACEAREA  Surface area of a cylinder.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
dihedralAngle


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 589
DIHEDRALANGLE Compute dihedral angle between 2 planes.

   THETA = dihedralAngle(PLANE1, PLANE2)
   PLANE1 and PLANE2 are plane representations given in the following
   format:
   [x0 y0 z0 dx1 dy1 dz1 dx2 dy2 dz2]
   THETA is the angle between the two vectors given by plane normals,
   given between 0 and PI.

   References
   http://en.wikipedia.org/wiki/Dihedral_angle
   http://mathworld.wolfram.com/DihedralAngle.html

   See also:
   planes3d, lines3d, angles3d, planesBisector

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 21/02/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
DIHEDRALANGLE Compute dihedral angle between 2 planes.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
distanceLines3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 817
DISTANCELINES3D Minimal distance between two 3D lines.

   D = distanceLines3d(LINE1, LINE2);
   Returns the distance between line LINE1 and the line LINE2, given as:
   LINE1 : [x0 y0 z0 dx dy dz] (or M-by-6 array)
   LINE2 : [x0 y0 z0 dx dy dz] (or N-by-6 array)
   D     : (positive) array M-by-N

   [D, PT1, PT2] = distanceLines3d(LINE1, LINE2);
   Also returns the points located on LINE1 and LINE2 corresponding to the
   shortest distance. 
   One should get the following:
   distancePoints3d(PT1, PT2) - D == 0


   Example
     line1 = [2 3 4 0 1 0];
     line2 = [8 8 8 0 0 1];
     distanceLines3d(line1, line2)
     ans = 
         6.0000

   See also:
   lines3d, distancePoints3d

   ---------
   authors: Brandon Baker, oqilipo, David Legland
   created January 19, 2011




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
DISTANCELINES3D Minimal distance between two 3D lines.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
distancePointEdge3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 810
DISTANCEPOINTEDGE3D Minimum distance between a 3D point and a 3D edge.

   DIST = distancePointEdge3d(POINT, EDGE);
   Return the euclidean distance between edge EDGE and point POINT. 
   EDGE has the form: [x1 y1 z1 x2 y2 z2], and POINT is [x y z].

   If EDGE is N-by-6 array, result is N-by-1 array computed for each edge.
   If POINT is a N-by-3 array, the result is computed for each point.
   If both POINT and EDGE are array, they must have the same number of
   rows, and the result is computed for each couple point(i,:);edge(i,:).

   [DIST POS] = distancePointEdge3d(POINT, EDGE);
   Also returns the position of closest point on the edge. POS is
   comprised between 0 (first point) and 1 (last point).

   See also:
   edges3d, points3d, distancePoints3d, distancePointLine3d
   



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
DISTANCEPOINTEDGE3D Minimum distance between a 3D point and a 3D edge.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
distancePointLine3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 452
DISTANCEPOINTLINE3D Euclidean distance between 3D point and line.

   D = distancePointLine3d(POINT, LINE);
   Returns the distance between point POINT and the line LINE, given as:
   POINT : [x0 y0 z0]
   LINE  : [x0 y0 z0 dx dy dz]
   D     : (positive) scalar  
   
   See also:
   lines3d, isPointOnLine3d, distancePointEdge3d, projPointOnLine3d,
   

   References
   http://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
DISTANCEPOINTLINE3D Euclidean distance between 3D point and line.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
distancePointPlane


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 457
DISTANCEPOINTPLANE Signed distance betwen 3D point and plane.

   D = distancePointPlane(POINT, PLANE)
   Returns the euclidean distance between point POINT and the plane PLANE,
   given by: 
   POINT : [x0 y0 z0]
   PLANE : [x0 y0 z0 dx1 dy1 dz1 dx2 dy2 dz2]
   D     : scalar  
   
   See also:
   planes3d, points3d, intersectLinePlane

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 18/02/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
DISTANCEPOINTPLANE Signed distance betwen 3D point and plane.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
distancePointTriangle3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1332
DISTANCEPOINTTRIANGLE3D Minimum distance between a 3D point and a 3D triangle.

   DIST = distancePointTriangle3d(PT, TRI);
   Computes the minimum distance between the point PT and the triangle
   TRI. The Point PT is given as a row vector of three coordinates. The
   triangle TRI is given as a 3-by-3 array containing the coordinates of
   each vertex in a row of the array:
   TRI = [...
      X1 Y1 Z1;...
      X2 Y2 Z2;...
      X3 Y3 Z3];

   [DIST, PROJ] = distancePointTriangle3d(PT, TRI);
   Also returns the coordinates of the projeced point.

   Example
      tri = [1 0 0; 0 1 0;0 0 1];
      pt = [0 0 0];
      dist = distancePointTriangle3d(pt, tri)
      dist =
           0.5774

   See also
   meshes3d, distancePointMesh, distancePointEdge3d, distancePointPlane

   Reference
   * David Eberly (1999), "Distance Between Point and Triangle in 3D"
   https://www.geometrictools.com/Documentation/DistancePoint3Triangle3.pdf
   * see <a href="matlab:
     web('https://fr.mathworks.com/matlabcentral/fileexchange/22857-distance-between-a-point-and-a-triangle-in-3d')
   ">Distance between a point and a triangle in 3d</a>, by Gwendolyn Fischer.
   (same algorithm, but different order of input argument)

   * https://fr.mathworks.com/matlabcentral/fileexchange/22857-distance-between-a-point-and-a-triangle-in-3d



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 78
DISTANCEPOINTTRIANGLE3D Minimum distance between a 3D point and a 3D triangle.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
distancePoints3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 716
DISTANCEPOINTS3D Compute euclidean distance between pairs of 3D Points.

   D = distancePoints3d(P1, P2) return distance between points P1 and
   P2, given as [X Y Z].
   
   If P1 and P2 are two arrays of points, result is a N1*N2 array
   containing distance between each point of P1 and each point of P2. 


   D = distancePoints3d(P1, P2, NOR)
   with NOR being 1, 2, or Inf, corresponfing to the norm used. Default is
   2 (euclidean norm). 1 correspond to manhattan (or taxi driver) distance
   and Inf to maximum difference in each coordinate.


   See also:
   points3d, minDistancePoints, distancePoints

   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 18/02/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 71
DISTANCEPOINTS3D Compute euclidean distance between pairs of 3D Points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
drawAxis3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 648
DRAWAXIS3D Draw a coordinate system and an origin.

   drawAxis3d
	Adds 3 cylinders to the current axis, corresponding to the directions
	of the 3 basis vectors Ox, Oy and Oz.
	Ox vector is red, Oy vector is green, and Oz vector is blue.

   drawAxis3d(L, R)
   Specifies the length L and the radius of the cylinders representing the
   different axes.

   Example
   drawAxis

   figure;
   drawAxis(20, 1);

   See also
   drawAxisCube

 ------
 Author: David Legland
 e-mail: david.legland@nantes.inra.fr
 Created: 2007-08-14,    using Matlab 7.4.0.287 (R2007a)
 Copyright 2007 INRA - BIA PV Nantes - MIAJ Jouy-en-Josas.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
DRAWAXIS3D Draw a coordinate system and an origin.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
drawAxisCube


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 181
DRAWAXISCUBE Draw a colored cube representing axis orientation.

   output = drawAxisCube(input)

   Example
   drawAxisCube

   See also
     drawAxis3d, createCube, patch



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
DRAWAXISCUBE Draw a colored cube representing axis orientation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
drawBox3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 663
DRAWBOX3D Draw a 3D box defined by coordinate extents.
   
   drawBox3d(BOX);
   Draw a box defined by its coordinate extents: 
   BOX = [XMIN XMAX YMIN YMAX ZMIN ZMAX].
   The function draws only the outline edges of the box.

   Example
     % Draw bounding box of a cubeoctehedron
     [v e f] = createCubeOctahedron;
     box3d = boundingBox3d(v);
     figure; hold on;
     drawMesh(v, f);
     drawBox3d(box3d);
     set(gcf, 'renderer', 'opengl')
     axis([-2 2 -2 2 -2 2]);
     view(3)

   See Also:
   boxes3d, boundingBox3d

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 10/12/2003.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
DRAWBOX3D Draw a 3D box defined by coordinate extents.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
drawCircle3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1904
DRAWCIRCLE3D Draw a 3D circle.

   Possible calls for the function:
   drawCircle3d([XC YC ZC R THETA PHI])
   drawCircle3d([XC YC ZC R], [THETA PHI])

   where XC, YC, ZY are coordinates of circle center, R is the circle
   radius, PHI and THETA are 3D angles in degrees of the normal to the
   plane containing the circle:
   * THETA between 0 and 180 degrees, corresponding to the colatitude
       (angle with Oz axis).
   * PHI between 0 and 360 degrees corresponding to the longitude (angle
       with Ox axis)
   
   drawCircle3d([XC YC ZC R THETA PHI PSI])
   drawCircle3d([XC YC ZC R], [THETA PHI PSI])
   drawCircle3d([XC YC ZC R], THETA, PHI)
   drawCircle3d([XC YC ZC], R, THETA, PHI)
   drawCircle3d([XC YC ZC R], THETA, PHI, PSI)
   drawCircle3d([XC YC ZC], R, THETA, PHI, PSI)
   drawCircle3d(XC, YC, ZC, R, THETA, PHI)
   drawCircle3d(XC, YC, ZC, R, THETA, PHI, PSI)
   Are other possible syntaxes for this function.
   
   H = drawCircle3d(...)
   return handle on the created LINE object

   Example
     % display 3 mutually orthogonal 3D circles
     figure; hold on; 
     drawCircle3d([10 20 30 50  0  0], 'LineWidth', 2, 'Color', 'b');
     drawCircle3d([10 20 30 50 90  0], 'LineWidth', 2, 'Color', 'r');
     drawCircle3d([10 20 30 50 90 90], 'LineWidth', 2, 'Color', 'g');
     axis equal;
     axis([-50 100 -50 100 -50 100]);
     view([-10 20])
 
     % Draw several circles at once
     center = [10 20 30];
     circ1 = [center 50  0  0];
     circ2 = [center 50 90  0];
     circ3 = [center 50 90 90];
     figure; hold on;
     drawCircle3d([circ1 ; circ2 ; circ3]);
     axis equal;

   See also:
   circles3d, drawCircleArc3d, drawEllipse3d, drawSphere

   ------
   Author: David Legland
   e-mail: david.legland@grignon.inra.fr
   Created: 2005-02-17
   Copyright 2005 INRA - CEPIA Nantes - MIAJ (Jouy-en-Josas).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
DRAWCIRCLE3D Draw a 3D circle.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
drawCircleArc3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 686
DRAWCIRCLEARC3D Draw a 3D circle arc.

   drawCircleArc3d([XC YC ZC R THETA PHI PSI START EXTENT])
   [XC YC ZC]  : coordinate of arc center
   R           : arc radius
   [THETA PHI] : orientation of arc normal, in degrees (theta: 0->180).
   PSI         : roll of arc (rotation of circle origin)
   START       : starting angle of arc, from arc origin, in degrees
   EXTENT      : extent of circle arc, in degrees (can be negative)
   
   Drawing options can be specified, as for the plot command.

   See also
   angles3, circles3d, drawCircle3d, drawCircleArc


   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 21/02/2005




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
DRAWCIRCLEARC3D Draw a 3D circle arc.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
drawCube


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 995
DRAWCUBE Draw a 3D centered cube, eventually rotated.

   drawCube(CUBE)
   Displays a 3D cube on current axis. CUBE is given by:
   [XC YC ZC SIDE THETA PHI PSI]
   where (XC, YC, ZC) is the CUBE center, SIDE is the length of the cube
   main sides, and THETA PHI PSI are angles representing the cube
   orientation, in degrees. THETA is the colatitude of the cube, between 0
   and 90 degrees, PHI is the longitude, and PSI is the rotation angle
   around the axis of the normal.

   CUBE can be axis aligned, in this case it should only contain center
   and side information:
   CUBE = [XC YC ZC SIDE]

   The function drawCuboid is closely related, but uses a different angle
   convention, and allows for different sizes along directions.

   Example
   % Draw a cube with small rotations
     figure; hold on;
     drawCube([10 20 30  50  10 20 30], 'FaceColor', 'g');
     axis equal;
     view(3);

   See also
   meshes3d, polyhedra, createCube, drawCuboid




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
DRAWCUBE Draw a 3D centered cube, eventually rotated.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
drawCuboid


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1038
DRAWCUBOID Draw a 3D cuboid, eventually rotated.

   drawCuboid(CUBOID)
   Displays a 3D cuboid on current axis. CUBOID is given by:
   [XC YC ZC L W D YAW PITCH ROLL],
   where (XC, YC, ZC) is the cuboid center, L, W and H are the lengths of
   the cuboid main axes, and YAW PITCH ROLL are Euler angles representing
   the cuboid orientation, in degrees. 

   If cuboid is axis-aligned, it can be specified using only center and
   side lengths:
   CUBOID = [XC YC ZC L W H]

   Example
   % Draw a basic rotated cuboid
     figure; hold on;
     drawCuboid([10 20 30   90 40 10   10 20 30], 'FaceColor', 'g');
     axis equal;
     view(3);

     % Draw three "borromean" cuboids
     figure; hold on;
     drawCuboid([10 20 30 90 50 10], 'FaceColor', 'r');
     drawCuboid([10 20 30 50 10 90], 'FaceColor', 'g');
     drawCuboid([10 20 30 10 90 50], 'FaceColor', 'b');
     view(3); axis equal;
     set(gcf, 'renderer', 'opengl')

   See also
   meshes3d, polyhedra, createCube, drawEllipsoid, drawCube




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
DRAWCUBOID Draw a 3D cuboid, eventually rotated.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
drawCylinder


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1747
DRAWCYLINDER Draw a cylinder.

   drawCylinder(CYL)
   where CYL is a cylinder defined by [x1 y1 z1 x2 y2 z2 r]:
   [x1 y2 z1] are coordinates of starting point, [x2 y2 z2] are
   coordinates of ending point, and R is the radius of the cylinder,
   draws the corresponding cylinder on the current axis.

   drawCylinder(CYL, N)
   uses N points for discretisation of angle. Default value is 32.

   drawCylinder(..., OPT)
   with OPT = 'open' (default) or 'closed', specify if bases of the
   cylinder should be drawn.

   drawCylinder(..., 'FaceColor', COLOR)
   Specifies the color of the cylinder. Any couple of parameters name and
   value can be given as argument, and will be transfered to the 'surf'
   matlab function

   drawCylinder(..., 'FaceAlpha', ALPHA)
   Specifies the transparency of the cylinder and of the optionnal caps.

   H = drawCylinder(...)
   returns a handle to the patch representing the cylinder.


   Example:
   figure;drawCylinder([0 0 0 10 20 30 5]);

   figure;drawCylinder([0 0 0 10 20 30 5], 'open');

   figure;drawCylinder([0 0 0 10 20 30 5], 'FaceColor', 'r');

   figure;
   h = drawCylinder([0 0 0 10 20 30 5]);
   set(h, 'facecolor', 'b');

   % Draw three mutually intersecting cylinders
     p0 = [30 30 30];
     p1 = [90 30 30];
     p2 = [30 90 30];
     p3 = [30 30 90];
     figure;
     drawCylinder([p0 p1 25], 'FaceColor', 'r');
     hold on
     drawCylinder([p0 p2 25], 'FaceColor', 'g');
     drawCylinder([p0 p3 25], 'FaceColor', 'b');
     axis equal
     set(gcf, 'renderer', 'opengl')
     view([60 30])

   See Also:
   cylinderMesh, drawEllipseCylinder, drawSphere, drawLine3d, surf
   intersectLineCylinder, cylinderSurfaceArea




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
DRAWCYLINDER Draw a cylinder.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
drawEdge3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 578
DRAWEDGE3D Draw 3D edge in the current axes.

   drawEdge3d(EDGE) draws the edge EDGE on the current axis. 
   EDGE has the form: [x1 y1 z1 x2 y2 z2]. No clipping is performed.
   
   drawEdge3d(AX,...) plots into AX instead of GCA.

   H = drawEdge3d(...) returns a handle H to the line object.

   See also
   drawLine3d, clipLine3d, drawEdge
   
 ---------
 author : David Legland 
 INRA - TPV URPOI - BIA IMASTE
 created the 18/02/2005.
   
   HISTORY
   04/01/2007 remove unused variables
   15/12/2009 "reprecate", and add processing of input arguments



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
DRAWEDGE3D Draw 3D edge in the current axes.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
drawEllipse3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1363
DRAWELLIPSE3D Draw a 3D ellipse.

   Possible calls for the function :
   drawEllipse3d([XC YC ZC A B THETA PHI])
   drawEllipse3d([XC YC ZC A B THETA PHI PSI])
   drawEllipse3d([XC YC ZC A B], [THETA PHI])
   drawEllipse3d([XC YC ZC A B], [THETA PHI PSI])
   drawEllipse3d([XC YC ZC A B], THETA, PHI)
   drawEllipse3d([XC YC ZC], A, B, THETA, PHI)
   drawEllipse3d([XC YC ZC A B], THETA, PHI, PSI)
   drawEllipse3d([XC YC ZC], A, B, THETA, PHI, PSI)
   drawEllipse3d(XC, YC, ZC, A, B, THETA, PHI)
   drawEllipse3d(XC, YC, ZC, A, B, THETA, PHI, PSI)

   where XC, YC, ZY are coordinate of ellipse center, A and B are the
   half-lengths of the major and minor axes of the ellipse,
   PHI and THETA are 3D angle (in degrees) of the normal to the plane
   containing the ellipse (PHI between 0 and 360 corresponding to
   longitude, and THETA from 0 to 180, corresponding to angle with
   vertical).
   
   H = drawEllipse3d(...)
   return handle on the created LINE object
   
   Example
     figure; axis([-10 10 -10 10 -10 10]); hold on;
     ellXY = [0 0 0  8 5  0 0 0];
     drawEllipse3d(ellXY, 'color', [.8 0 0], 'linewidth', 2)
     ellXZ = [0 0 0  8 2  90 90 90];
     drawEllipse3d(ellXZ, 'color', [0 .8 0], 'linewidth', 2)
     ellYZ = [0 0 0  5 2  90 0 90];
     drawEllipse3d(ellYZ, 'color', [0 0 .8], 'linewidth', 2)
 



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
DRAWELLIPSE3D Draw a 3D ellipse.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
drawEllipseCylinder


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1835
DRAWELLIPSECYLINDER Draw a cylinder with ellipse cross-section.

   drawEllipseCylinder(CYL)
   draws the cylinder CYL on the current axis.
   CYL is a cylinder defined by [x1 y1 z1 x2 y2 z2 r1 r2 roll], with:
   * [x1 y2 z1] are coordinates of starting point,
   * [x2 y2 z2] are coordinates of ending point, 
   * R1 and R2 are the lengths of the ellipse semi axes, and
   * ROLL is the rotation of the cylinder around its main axis (in
      degrees)

   drawEllipseCylinder(CYL, N)
   uses N points for discretisation of angle. Default value is 32.

   drawEllipseCylinder(..., OPT)
   with OPT = 'open' (default) or 'closed', specify if bases of the
   cylinder should be drawn.

   drawEllipseCylinder(..., 'FaceColor', COLOR)
   Specifies the color of the cylinder. Any couple of parameters name and
   value can be given as argument, and will be transfered to the 'surf'
   matlab function

   H = drawEllipseCylinder(...)
   returns a handle to the patch representing the cylinder.


   Example:
   figure;drawEllipseCylinder([0 0 0 10 20 30 5]);

   figure;drawEllipseCylinder([0 0 0 10 20 30 5], 'open');

   figure;drawEllipseCylinder([0 0 0 10 20 30 5], 'FaceColor', 'r');

   figure;
   h = drawEllipseCylinder([0 0 0 10 20 30 5]);
   set(h, 'facecolor', 'b');

   % Draw three mutually intersecting elliptic cylinders
     p1 = [30 0 0];
     p2 = [0 30 0];
     p3 = [0 0 30];
     radii = [20 10];
     figure;
     drawEllipseCylinder([-p1 p1 radii 0], 'FaceColor', 'r');
     hold on
     drawEllipseCylinder([-p2 p2 radii 90], 'FaceColor', 'g');
     drawEllipseCylinder([-p3 p3 radii 90], 'FaceColor', 'b');
     axis equal
     set(gcf, 'renderer', 'opengl')
     view([60 30]); light;

   See Also:
   drawCylinder, drawSphere, cylinderMesh, drawLine3d, surf



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
DRAWELLIPSECYLINDER Draw a cylinder with ellipse cross-section.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
drawEllipsoid


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 902
DRAWELLIPSOID Draw a 3D ellipsoid.

   drawEllipsoid(ELLI)
   Displays a 3D ellipsoid on current axis. ELLI is given by:
   [XC YC ZC A B C PHI THETA PSI],
   where (XC, YC, ZC) is the ellipsoid center, A, B and C are the half
   lengths of the ellipsoid main axes, and PHI THETA PSI are Euler angles
   representing ellipsoid orientation, in degrees.

   drawEllipsoid(..., 'drawEllipses', true)
   Also displays the main 3D ellipses corresponding to XY, XZ and YZ
   planes.


   Example
     figure; hold on;
     drawEllipsoid([10 20 30   50 30 10   5 10 0]);
     axis equal;

     figure; hold on;
     elli = [[10 20 30   50 30 10   5 10 0];
     drawEllipsoid(elli, 'FaceColor', 'r', ...
         'drawEllipses', true, 'EllipseColor', 'b', 'EllipseWidth', 3);
     axis equal;

   See also
   spheres, drawSphere, inertiaEllipsoid, ellipsoid, drawTorus, drawCuboid 




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
DRAWELLIPSOID Draw a 3D ellipsoid.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
drawGrid3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 931
DRAWGRID3D Draw a 3D grid on the current axis.

   drawGrid3d
   draws a 3D square grid, with origin (0,0,0) and spacing 1 in each
   direction, with bounds corresponding to the bounds of current axis.

   drawGrid3d(SPACING)
   where spacing is either a scalar or a [1x3] matrix, specifies the size
   of the unit cell.

   drawGrid3d(ORIGIN, SPACING)
   Also specify origin of grid. ORIGIN is a [1x3] array.

   drawGrid3d(..., EDGE)
   specifies whether function should draw edges touching edges of axis.
   EDGE is a characheter string, which can be :
   - 'OPEN' : each line start from one face of window to the opposite
   face. This results in a 'spiky' grid.
   - 'CLOSED' (default value) : each line stops at the last visible point
   of the grid for this line. The result looks like a box (no free spikes
   around the grid).

   H = drawGrid3d(...);
   return a vector of handles for each LINE object which was crated.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
DRAWGRID3D Draw a 3D grid on the current axis.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
drawLabels3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 574
DRAWLABELS3D Draw text labels at specified 3D positions.
   
   drawLabels3d(X, Y, Z, LBL) draw labels LBL at position X and Y.
   LBL can be either a string array, or a number array. In this case,
   string are created by using sprintf function, with '%.2f' mask.

   drawLabels3d(POS, LBL) draw labels LBL at position specified by POS,
   where POS is a N-by-3 int array.

   drawLabels3d(..., NUMBERS, FORMAT) create labels using sprintf function,
   with the mask given by FORMAT (e. g. '%03d' or '5.3f'), and the
   corresponding values.

   See also 
     drawLabels




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
DRAWLABELS3D Draw text labels at specified 3D positions.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
drawLine3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 890
DRAWLINE3D Draw a 3D line clipped by the current axes.

   drawLine3d(LINE) draws the line LINE on the current axis, by clipping 
   with the current axis.

   drawLine3d(LINE, PARAM, VALUE) accepts parameter/value pairs, like 
   for plot function. Color of the line can also be given as a single 
   parameter.

   drawLine3d(AX,...) plots into AX instead of GCA.
   
   H = drawLine3d(...) returns a handle to the created line object. 
   If the line is not clipped by the axis, function returns -1.

   Example
     % draw a sphere together with the three main axes
     figure; hold on;
     drawSphere([40 30 20 30]);
     view(3); axis equal; axis([-20 80 -20 80 -20 80])
     drawLine3d([0 0 0   1 0 0], 'k');
     drawLine3d([0 0 0   0 1 0], 'k');
     drawLine3d([0 0 0   0 0 1], 'k');
     light;


   See also:
     lines3d, createLine3d, clipLine3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
DRAWLINE3D Draw a 3D line clipped by the current axes.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
drawPartialPatch


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 498
DRAWPARTIALPATCH draw surface patch, with 2 parametrized surfaces.

   usage :
   drawSurfPatch(u, v, zuv)
   where u, v, and zuv are three matrices the same size, u and
   corresponding to each parameter, and zuv being equal to a function of u
   and v.

   drawSurfPatch(u, v, zuv, p0)
   If p0 is specified, two lines with u(p0(1)) and v(p0(2)) are drawn on
   the surface


   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 24/05/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
DRAWPARTIALPATCH draw surface patch, with 2 parametrized surfaces.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
drawPlane3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 784
DRAWPLANE3D Draw a plane clipped by the current axes.

   drawPlane3d(PLANE) draws a plane of the format:
       [x0 y0 z0  dx1 dy1 dz1  dx2 dy2 dz2]

   drawPlane3d(...,'PropertyName',PropertyValue,...) sets the value of the
   specified patch property. Multiple property values can be set with
   a single statement. See function patch for details.

   drawPlane3d(AX,...) plots into AX instead of GCA.

   H = drawPlane3d(...) returns a handle H to the patch object.

   Example

     p0 = [1 2 3];
     v1 = [1 0 1];
     v2 = [0 -1 1];
     plane = [p0 v1 v2];
     axis([-10 10 -10 10 -10 10]);
     drawPlane3d(plane)
     drawLine3d([p0 v1])
     drawLine3d([p0 v2])
     set(gcf, 'renderer', 'zbuffer');

   See also
   planes3d, createPlane, patch



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
DRAWPLANE3D Draw a plane clipped by the current axes.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
drawPlatform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 810
DRAWPLATFORM Draw a rectangular platform with a given size.

   drawPlatform(PLANE, SIZ) draws a rectangular platform with the
   dimensions specified by SIZ. If SIZ contains only one value instead of 
   two the platform will be quadratic.

   drawPlatform(...,'PropertyName',PropertyValue,...) sets the value of 
   the specified patch property. Multiple property values can be set with
   a single statement. See function patch for details.

   drawPlane3d(AX,...) plots into AX instead of GCA.

   H = drawPlatform(...) returns a handle H to the patch object.

   Example

     p0 = [1 2 3];
     v1 = [1 0 1];
     v2 = [0 -1 1];
     plane = [p0 v1 v2];
     axis([-10 10 -10 10 -10 10]);
     drawPlatform(plane, [7,3])
     set(gcf, 'renderer', 'zbuffer');

   See also
   planes3d, createPlane, patch



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
DRAWPLATFORM Draw a rectangular platform with a given size.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
drawPoint3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 845
DRAWPOINT3D Draw 3D point on the current axis.

   drawPoint3d(X, Y, Z) 
   will draw points defined by coordinates X, Y and Z. 
   X, Y and Z are N*1 array, with N being number of points to be drawn.
   
   drawPoint3d(COORD) packs coordinates in a single [N*3] array.

   drawPoint3d(..., OPT) will draw each point with given option. OPT is a 
   string compatible with 'plot' model.

   drawPoint3d(AX,...) plots into AX instead of GCA.

   H = drawPoint3d(...) returns a handle H to the line object

   Example
     % generate points on a 3D circle
     pts = circleToPolygon([40 30 20], 120);
     mat = eulerAnglesToRotation3d([30 20 10]);
     pts3d = transformPoint3d([pts zeros(120,1)],mat);
     figure; drawPoint3d(pts3d, 'b.');
     view(3); axis equal;

   See also
     points3d, clipPoints3d, drawPoint




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
DRAWPOINT3D Draw 3D point on the current axis.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
drawPolygon3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 698
DRAWPOLYGON3D Draw a 3D polygon specified by a list of vertex coords.

   drawPolygon3d(POLY);
   packs coordinates in a single N-by-3 array.

   drawPolygon3d(PX, PY, PZ);
   specifies coordinates in separate numeric vectors (either row or
   columns)

   drawPolygon3d(..., PARAM, VALUE);
   Specifies style options to draw the polyline, see plot for details.

   H = drawPolygon3d(...);
   also returns a handle to the list of created line objects. 

   Example
     t = linspace(0, 2*pi, 100)';
     xt = 10 * cos(t);
     yt = 5 * sin(t);
     zt = zeros(1,100);
     figure; drawPolygon3d(xt, yt, zt, 'b');
 
   See Also:
   polygons3d, fillPolygon3d, drawPolyline3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
DRAWPOLYGON3D Draw a 3D polygon specified by a list of vertex coords.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
drawPolyline3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 918
DRAWPOLYLINE3D Draw a 3D polyline specified by a list of vertex coords.

   drawPolyline3d(POLY);
   packs coordinates in a single N-by-3 array.

   drawPolyline3d(PX, PY, PZ);
   specifies coordinates in separate numeric vectors (either row or
   columns)

   drawPolyline3d(..., CLOSED);
   Specifies if the polyline is closed or open. CLOSED can be one of:
   - 'closed'
   - 'open'    (the default)
   - a boolean variable with value TRUE for closed polylines.

   drawPolyline3d(..., PARAM, VALUE);
   Specifies style options to draw the polyline, see plot for details.

   H = drawPolyline3d(...);
   also returns a handle to the list of created line objects.

   Example
     t = linspace(0, 2*pi, 100)';
     xt = 10 * cos(t);
     yt = 5 * sin(t);
     zt = zeros(1,100);
     figure; drawPolyline3d(xt, yt, zt, 'b');
 
   See Also:
   polygons3d, drawPolygon3d, fillPolygon3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 71
DRAWPOLYLINE3D Draw a 3D polyline specified by a list of vertex coords.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
drawSphere


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1863
DRAWSPHERE Draw a sphere as a mesh.

   drawSphere(SPHERE)
   Where SPHERE = [XC YC ZC R], draw the sphere centered on the point with
   coordinates [XC YC ZC] and with radius R, using a quad mesh.

   drawSphere(CENTER, R)
   Where CENTER = [XC YC ZC], specifies the center and the radius with two
   arguments.

   drawSphere(XC, YC, ZC, R)
   Specifiy sphere center and radius as four arguments.

   drawSphere(..., NAME, VALUE);
   Specifies one or several options using parameter name-value pairs.
   Available options are usual drawing options, as well as:
   'nPhi'    the number of arcs used for drawing the meridians
   'nTheta'  the number of circles used for drawing the parallels

   H = drawSphere(...)
   Return a handle to the graphical object created by the function.

   [X Y Z] = drawSphere(...)
   Return the coordinates of the vertices used by the sphere. In this
   case, the sphere is not drawn.

   Example
   % Draw four spheres with different centers
     figure(1); clf; hold on;
     drawSphere([10 10 30 5]);
     drawSphere([20 30 10 5]);
     drawSphere([30 30 30 5]);
     drawSphere([30 20 10 5]);
     view([-30 20]); axis equal; l = light;

   % Draw sphere with different settings
     figure(1); clf;
     drawSphere([10 20 30 10], 'linestyle', ':', 'facecolor', 'r');
     axis([0 50 0 50 0 50]); axis equal;
     l = light;

   % The same, but changes style using graphic handle
     figure(1); clf;
     h = drawSphere([10 20 30 10]);
     set(h, 'linestyle', ':');
     set(h, 'facecolor', 'r');
     axis([0 50 0 50 0 50]); axis equal;
     l = light;
   
   % Draw a sphere with high resolution
     figure(1); clf;
     h = drawSphere([10 20 30 10], 'nPhi', 360, 'nTheta', 180);
     l = light; view(3);


   See also
   spheres, circles3d, sphere, drawEllipsoid



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
DRAWSPHERE Draw a sphere as a mesh.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
drawSphericalEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 532
DRAWSPHERICALEDGE Draw an edge on the surface of a sphere.

   drawSphericalEdge(SPHERE, EDGE)
   EDGE is given as a couple of 3D coordinates corresponding to edge
   extremities. The shortest spherical edge joining the two extremities is
   drawn on the current axes.

   Example
   drawSphericalEdge

   See also
   drawSphericalPolygon

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2012-02-09,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2012 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
DRAWSPHERICALEDGE Draw an edge on the surface of a sphere.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
drawSphericalPolygon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 329
DRAWSPHERICALPOLYGON  Draw a spherical polygon.

   output = drawSphericalPolygon(input)

   Example
   drawSphericalPolygon

   See also


 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2012-02-09,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2012 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
DRAWSPHERICALPOLYGON  Draw a spherical polygon.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
drawSphericalTriangle


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 946
DRAWSPHERICALTRIANGLE Draw a triangle on a sphere.

   drawSphericalTriangle(SPHERE, PT1, PT2, PT3);
   Draws the spherical triangle defined by the three input 3D points and
   the reference sphere. 
   Points are given as 3D points, and are projected onto the sphere. The
   order of the points is not relevant. 

   drawSphericalTriangle(SPHERE, PT1, PT2, PT3, OPTIONS);
   Allows to specify plot options for spherical edges, in the form of
   parameter name-value pairs.

   Example
     % Draw a sphere and a spherical triangle on it
     s = [0 0 0 2];
     pts = [1 0 0;0 -1 0;0 0 1];
     drawSphere(s); hold on;
     drawSphericalTriangle(s, pts(1,:), pts(2,:), pts(3,:), 'linewidth', 2);
     view(3); axis equal;

   See also
   drawSphere, fillSphericalTriangle, drawSphericalPolygon,
   drawSphericalEdge

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 22/02/2005




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
DRAWSPHERICALTRIANGLE Draw a triangle on a sphere.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
drawSurfPatch


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 542
DRAWSURFPATCH Draw a 3D surface patch, with 2 parametrized surfaces.

   usage:
   drawSurfPatch(u, v, zuv)
   where u, v, and zuv are three matrices the same size, u and
   corresponding to each parameter, and zuv being equal to a function of u
   and v.

   drawSurfPatch(u, v, zuv, p0)
   If p0 is specified, two lines with u(p0(1)) and v(p0(2)) are drawn on
   the surface, and corresponding tangent are also shown.


   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 24/05/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
DRAWSURFPATCH Draw a 3D surface patch, with 2 parametrized surfaces.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
drawTorus


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 895
DRAWTORUS Draw a torus (3D ring).

   drawTorus(TORUS)
   Draws the torus on the current axis. TORUS is given by:
   [XC YC ZY  R1 R2  THETA PHI]
   where (XC YZ ZC) is the center of the torus, R1 is the main radius, R2
   is the radius of the torus section, and (THETA PHI) is the angle of the
   torus normal vector (both in degrees).

   drawTorus(..., PNAME, PVALUE)
   Specifies a set of parameter name-value pairs. Parameter names include
   plitting options ('facecolor', 'linestyle'...), or options specific to
   torus:
   'nPhi'      number of meridians used to draw the torus (default is 60).
   'nTheta'    number of parallels used to draw the torus (default is 60).


   Example
     % draw sample torus
     figure;
     drawTorus([50 50 50 30 10 30 45]);
     axis equal; view([95 10]); light;

   See also
   drawEllipsoid, revolutionSurface, torusMesh




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
DRAWTORUS Draw a torus (3D ring).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
drawVector3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 511
DRAWVECTOR3D Draw vector at a given position.

   drawVector3d(POS, VECT)
   Draws the vector VECT starting at the position POS. Both VECT and POS
   are N-by-3 arrays.

   drawVector3d(..., PNAME, PVALUE)
   Specifies additional optional parameters that will be given to the
   quiver3 function.

   Example
     figure; hold on;
     drawVector3d([2 3 4], [1 0 0]);
     drawVector3d([2 3 4], [0 1 0]);
     drawVector3d([2 3 4], [0 0 1]);
     view(3);

   See also
   vectors3d, quiver3




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
DRAWVECTOR3D Draw vector at a given position.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
edgeLength3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 356
EDGELENGTH3D Return the length of a 3D edge.

   L = edgeLength3D(EDGE);  
   Returns the length of a 3D edge, with following representation:
   [x1 y1 z1 x2 y2 z2].

   Example
     p1 = [1 1 1];
     p2 = [3 4 5];
     edge = createEdge3d(p1, p2);
     edgeLength3d(edge)
     ans =
         5.3852
   
   See also
     edges3d, createEdge3d, drawEdge3d



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
EDGELENGTH3D Return the length of a 3D edge.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
edgeToLine3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 424
EDGETOLINE3D Convert a 3D edge to a 3D straight line.

   LINE = edgeToLine3d(EDGE)
   Returns the 3D straight line containing the 3D edge EDGE.
   EDGE is represented as [X1 Y1 Z1  X2 Y2 Z2]
   LINE is represented as [X0 Y0 Z0  DX DY DZ]

   Example
       edge = [3 4 5  4 6 8];
       line = edgeToLine3d(edge)
       line = 
            3   4   5   1   2   3

   See also
     lines3d, edges3d, edgeToLine, lineToEdge3d



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
EDGETOLINE3D Convert a 3D edge to a 3D straight line.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
edges3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 436
EDGES3D  Description of functions operating on 3D edges.

   A 3D edge is represented by the coordinates of its extremities:
   EDGE = [X1 Y1 Z1  X2 Y2 Z2];

   A set of 3D edges is represented by a N-by-6 array, each row
   representing an edge.

   See also
   lines3d, edges2d, createEdge3d, edgeLength3d
   intersectEdgePlane, edgeToLine3d, edgeToLine3d, clipEdge3d, midPoint3d
   distancePointEdge3d, drawEdge3d, drawSphericalEdge



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
EDGES3D  Description of functions operating on 3D edges.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
ellipsoidSurfaceArea


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 919
ELLIPSOIDSURFACEAREA  Approximated surface area of an ellipsoid.

   S = ellipsoidSurfaceArea(ELLI)
   Computes an approximation of the surface area of an ellipsoid. 
   ELLI is a 1-by-9 row vector given by [XC YC ZC A B C THETA PHI PSI],
   where (XC YC ZC) is the center, (A B C) is the length of each semi axis
   and (THETA PHI PSI) representes the orientation.
   If ELLI is a 1-by-3 row vector, it is assumed to contain only the
   lengths of semi-axes.

   This functions computes an approximation of the surface area, given by:
   S = 4 * pi * ( (a^p * b^p + a^p * c^p + b^p * c^p) / 3) ^ (1/p)
   with p = 1.6075. The resulting error should be less than 1.061%.

   Example
   ellipsoidSurfaceArea

   See also
   geom3d, ellipsePerimeter, oblateSurfaceArea, prolateSurfaceArea

   References
   * http://en.wikipedia.org/wiki/Ellipsoid
   * http://mathworld.wolfram.com/Ellipsoid.html




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
ELLIPSOIDSURFACEAREA  Approximated surface area of an ellipsoid.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
equivalentEllipsoid


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1052
 Equivalent ellipsoid of a set of 3D points.

   ELL = equivalentEllipsoid(PTS)
   Compute the equivalent ellipsoid of the set of points PTS. The result
   is an ellipsoid defined by:
   ELL = [XC YC ZC  A B C  PHI THETA PSI]
   where [XC YC ZY] is the center, [A B C] are the lengths of the
   semi-axes (in decreasing order), and [PHI THETA PSI] are Euler angles
   representing  the ellipsoid orientation, in degrees.

   Example
     pts = randn(300, 3);
     pts = transformPoint3d(pts, createScaling3d([6 4 2]));
     pts = transformPoint3d(pts, createRotationOx(pi/6));
     pts = transformPoint3d(pts, createRotationOy(pi/4));
     pts = transformPoint3d(pts, createRotationOz(pi/3));
     pts = transformPoint3d(pts, createTranslation3d([5 4 3]));
     elli = equivalentEllipsoid(pts);
     figure; drawPoint3d(pts); axis equal;
     hold on; drawEllipsoid(elli, ...
         'drawEllipses', true, 'EllipseColor', 'b', 'EllipseWidth', 3);

   See also
     spheres, drawEllipsoid, equivalentEllipse, principalAxes
     rotation3dToEulerAngles



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
 Equivalent ellipsoid of a set of 3D points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
eulerAnglesToRotation3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1701
EULERANGLESTOROTATION3D Convert 3D Euler angles to 3D rotation matrix.

   MAT = eulerAnglesToRotation3d(PHI, THETA, PSI)
   Creates a rotation matrix from the 3 euler angles PHI THETA and PSI,
   given in degrees, using the 'XYZ' convention (local basis), or the
   'ZYX' convention (global basis). The result MAT is a 4-by-4 rotation
   matrix in homogeneous coordinates.

   PHI:    rotation angle around Z-axis, in degrees, corresponding to the
       'Yaw'. PHI is between -180 and +180.
   THETA:  rotation angle around Y-axis, in degrees, corresponding to the
       'Pitch'. THETA is between -90 and +90.
   PSI:    rotation angle around X-axis, in degrees, corresponding to the
       'Roll'. PSI is between -180 and +180.
   These angles correspond to the "Yaw-Pitch-Roll" convention, also known
   as "Tait-Bryan angles".

   The resulting rotation is equivalent to a rotation around X-axis by an
   angle PSI, followed by a rotation around the Y-axis by an angle THETA,
   followed by a rotation around the Z-axis by an angle PHI.
   That is:
       ROT = Rz * Ry * Rx;

   MAT = eulerAnglesToRotation3d(ANGLES)
   Concatenates all angles in a single 1-by-3 array.
   
   ... = eulerAnglesToRotation3d(ANGLES, CONVENTION)
   CONVENTION specifies the axis rotation sequence. 
   Supported conventions are: 'ZYX', 'ZYZ'. Default is 'ZYX'.

   Example
   [n e f] = createCube;
   phi     = 20;
   theta   = 30;
   psi     = 10;
   rot = eulerAnglesToRotation3d(phi, theta, psi);
   n2 = transformPoint3d(n, rot);
   drawPolyhedron(n2, f);

   See also
   transforms3d, createRotationOx, createRotationOy, createRotationOz
   rotation3dAxisAndAngle




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
EULERANGLESTOROTATION3D Convert 3D Euler angles to 3D rotation matrix.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
fillPolygon3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 833
FILLPOLYGON3D Fill a 3D polygon specified by a list of vertex coords.

   fillPolygon3d(COORD, COLOR)
   packs coordinates in a single [N*3] array.
   COORD can also be a cell array of polygon, in this case each polygon is
   drawn using the same color.

   fillPolygon3d(PX, PY, PZ, COLOR)
   specifies coordinates in separate numeric vectors (either row or
   columns)

   fillPolygon3d(..., PARAM, VALUE)
   allows to specify some drawing parameter/value pairs as for the plot
   function.

   H = fillPolygon3d(...) 
   also returns a handle to the list of created patch objects. 

   Example
     t = linspace(0, 2*pi, 100)';
     xt = 10 * cos(t);
     yt = 5 * sin(t);
     zt = zeros(1,100);
     figure; fillPolygon3d(xt, yt, zt, 'c');
 
   See Also:
   polygons3d, drawPolygon3d, drawPolyline3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
FILLPOLYGON3D Fill a 3D polygon specified by a list of vertex coords.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
fillSphericalPolygon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 393
FILLSPHERICALPOLYGON  Fill a spherical polygon.

   fillSphericalPolygon(SPHERE, POLY, GERM)


   Example
   fillSphericalPolygon

   See also
   drawSphericalPolygon, fillSphericalTriangle, drawSphere

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2012-02-09,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2012 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
FILLSPHERICALPOLYGON  Fill a spherical polygon.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
fillSphericalTriangle


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 287
FILLSPHERICALTRIANGLE Fill a triangle on a sphere.

   fillSphericalTriangle(SPHERE, PT1, PT2, PT3);


   See also
   fillSphericalPolygon, drawSphericalTriangle, drawSphere

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 22/02/2005




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
FILLSPHERICALTRIANGLE Fill a triangle on a sphere.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
fitAffineTransform3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 434
FITAFFINETRANSFORM3D Fit an affine transform using two point sets.

   TRANS = fitAffineTransform3d(PTS1, PTS2)

   Example
     N = 50;
     pts = rand(N, 3)*10;
     trans = createRotationOx([5 4 3], pi/4);
     pts2 = transformPoint3d(pts, trans);
     pts3 = pts2 + randn(N, 3)*2;
     fitted = fitAffineTransform3d(pts, pts2);
   

   See also
     transforms3d, transformPoint3d, transformVector3d,
     registerPoints3dAffine




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
FITAFFINETRANSFORM3D Fit an affine transform using two point sets.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
fitCircle3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1230
FITCIRCLE3D Fit a 3D circle to a set of points.

   [FITTEDCIRCLE, CIRCLENORMAL] = fitCircle3d(PTS)

   Example
     % points on a 2d circle with noise
     nop = randi([5 50],1,1);
     radius = randi([5 25],1,1);
     points2d = circleToPolygon([0 0 radius], nop);
     points2d(1,:) = [];
     points2d = points2d + rand(size(points2d));
     points2d(:,3)=rand(length(nop),1);
     % apply random rotation and translation
     [theta, phi] = randomAngle3d;
     theta = rad2deg(theta);
     phi = rad2deg(phi);
     tfm = eulerAnglesToRotation3d(phi, theta, 0);
     trans = randi([-250 250],3,1);
     tfm(1:3,4)=trans;
     points3d = awgn(transformPoint3d(points2d, tfm),1);
     % fit 3d circle
     [fittedCircle, circleNormal] = fitCircle3d(points3d);
     % plot 3d points and 3d circle
     figure('Color','w'); hold on; axis equal tight; view(3);
     xlabel('X');ylabel('Y');zlabel('Z');
     drawPoint3d(points3d)
     drawCircle3d(fittedCircle, 'k')
     drawVector3d(fittedCircle(1:3), circleNormal*fittedCircle(4))

   See also
   circle3dOrigin, circle3dPosition, circle3dPoint, intersectPlaneSphere
   drawCircle3d, drawCircleArc3d, drawEllipse3d

 ------
 Authors: oqilipo, David Legland
 created: 2017-05-09



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
FITCIRCLE3D Fit a 3D circle to a set of points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
fitEllipse3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1186
FITELLIPSE3D Fit an ellipse to a set of points.

   FITTEDELLIPSE3D = fitEllipse3d(POINTS) returns the 3D ellipse fitted to
   a set of 3D points.

   Example
     % Create 2D ellipse
     n=randi([10,100]);
     a=randi([30,50]); b=randi([5,25]);
     [x, y] = ellipseToPolygon([0 0 a b 0 ], n);
     % 3D and add some noise
     points = [x, y, zeros(n,1)];
     points=points+(-1+2*rand(n,3));
     % Create a random transformation
     center=-100+200*rand(1,3);
     phi=randi([-180,180]); theta=randi([-180,180]); psi=randi([-180,180]);
     TFM=eulerAnglesToRotation3d(phi, theta, psi, 'ZYZ'); TFM(1:3,4)=center';
     points = transformPoint3d(points, TFM);
     % Fit ellipse
     [fE, fTFM] = fitEllipse3d(points, 'vis', true);
     % Plot reconstructed ellipse
     [fx, fy] = ellipseToPolygon([0 0 fE(4), fE(5) 0 ], n);
     fpoints = transformPoint3d([fx, fy, zeros(n,1)], fTFM);
     drawEllipse3d(fE,'k')
   
   See also
     drawEllipse3d, ellipseToPolygon

   Source
     Nested functions are part of the quadfit toolbox of Levente Hunyadi
     https://de.mathworks.com/matlabcentral/fileexchange/45356

 ---------
 Author: oqilipo
 Created: 2017-08-11
 Copyright 2017



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
FITELLIPSE3D Fit an ellipse to a set of points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
fitLine3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 750
FITLINE3D Fit a 3D line to a set of points.

   LINE = fitLine3d(PTS)

   Example
     pts = randn(300, 3);
     pts = transformPoint3d(pts, createScaling3d([6 4 2]));
     pts = transformPoint3d(pts, createRotationOx(pi/6));
     pts = transformPoint3d(pts, createRotationOy(pi/4));
     pts = transformPoint3d(pts, createRotationOz(pi/3));
     pts = transformPoint3d(pts, createTranslation3d([5 4 3]));
     elli = inertiaEllipsoid(pts);
     figure; drawPoint3d(pts); axis equal;
     hold on; drawEllipsoid(elli, ...
         'drawEllipses', true, 'EllipseColor', 'b', 'EllipseWidth', 3);
     line = fitLine3d(pts);
     drawLine3d(line, 'color', 'm', 'LineWidth', 4);

   See also
     lines3d, inertiaEllipsoid, fitPlane




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
FITLINE3D Fit a 3D line to a set of points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
fitPlane


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 733
FITPLANE  Fit a 3D plane to a set of points.

   PLANE = fitPlane(POINTS)

   Example
     pts = randn(300, 3);
     pts = transformPoint3d(pts, createScaling3d([6 4 2]));
     pts = transformPoint3d(pts, createRotationOx(pi/6));
     pts = transformPoint3d(pts, createRotationOy(pi/4));
     pts = transformPoint3d(pts, createRotationOz(pi/3));
     pts = transformPoint3d(pts, createTranslation3d([5 4 3]));
     elli = inertiaEllipsoid(pts);
     figure; drawPoint3d(pts); axis equal;
     hold on; drawEllipsoid(elli, ...
         'drawEllipses', true, 'EllipseColor', 'b', 'EllipseWidth', 3);
     plane = fitPlane(pts);
     drawPlane3d(plane, 'm');

   See also
     planes3d, inertiaEllipsoid, fitLine3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
FITPLANE  Fit a 3D plane to a set of points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
hypot3


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 585
HYPOT3 Diagonal length of a cuboidal 3D box .

   h = hypot3(a, b, c)
   computes the quantity sqrt(a^2 + b^2 + c^2), by avoiding roundoff
   errors.

   Example
     % Compute diagonal of unit cube
     hypot3(1, 1, 1)
     ans =
          1.7321

     % Compute more complicated diagonal
     hypot3(3, 4, 5)
     ans = 
         7.0711
          
   See also
   hypot, vectorNorm3d

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2012-04-29,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2012 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
HYPOT3 Diagonal length of a cuboidal 3D box .



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
inertiaEllipsoid


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1065
INERTIAELLIPSOID Inertia ellipsoid of a set of 3D points.

   Note: Deprecated! Use equivalentEllipsoid instead.


   ELL = inertiaEllipsoid(PTS)
   Compute the inertia ellipsoid of the set of points PTS. The result is
   an ellipsoid defined by:
   ELL = [XC YC ZC A B C PHI THETA PSI]
   where [XC YC ZY] is the center, [A B C] are lengths of semi-axes (in
   decreasing order), and [PHI THETA PSI] are euler angles representing 
   the ellipsoid orientation, in degrees.

   Example
     pts = randn(300, 3);
     pts = transformPoint3d(pts, createScaling3d([6 4 2]));
     pts = transformPoint3d(pts, createRotationOx(pi/6));
     pts = transformPoint3d(pts, createRotationOy(pi/4));
     pts = transformPoint3d(pts, createRotationOz(pi/3));
     pts = transformPoint3d(pts, createTranslation3d([5 4 3]));
     elli = inertiaEllipsoid(pts);
     figure; drawPoint3d(pts); axis equal;
     hold on; drawEllipsoid(elli, ...
         'drawEllipses', true, 'EllipseColor', 'b', 'EllipseWidth', 3);

   See also
     equivalentEllipsoid




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
INERTIAELLIPSOID Inertia ellipsoid of a set of 3D points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
intersectBoxes3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 474
INTERSECTBOXES3D Intersection of two 3D bounding boxes.

   RES = intersectBoxes3d(BOX1, BOX2)

   Example
   box1 = [5 20 5 30 10 50];
   box2 = [0 15 0 15 0 20];
   intersectBoxes3d(box1, box2)
   ans = 
       5 15 5 15 10 20

   See also
   boxes3d, drawBox3d, mergeBoxes3d


 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2010-07-26,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
INTERSECTBOXES3D Intersection of two 3D bounding boxes.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
intersectEdgePlane


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 861
INTERSECTEDGEPLANE Return intersection point between a plane and a edge.

   PT = intersectEdgePlane(edge, PLANE) return the intersection point of
   the given edge and the given plane.
   PLANE : [x0 y0 z0 dx1 dy1 dz1 dx2 dy2 dz2]
   edge :  [x1 y1 z1 x2 y2 z2]
   PT :    [xi yi zi]
   If EDGE and PLANE are parallel, return [NaN NaN NaN].
   If EDGE (or PLANE) is a matrix with 6 (or 9) columns and N rows, result
   is an array of points with N rows and 3 columns.
   
   Example:
   edge = [5 5 -1 5 5 1];
   plane = [0 0 0 1 0 0 0 1 0];
   intersectEdgePlane(edge, plane)     % should return [5 5 0].
   ans =
       5   5   0

   See Also:
   planes3d, intersectLinePlane, createLine3d, createPlane


   ---------

   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 24/04/2007 from intersectLinePlane.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 72
INTERSECTEDGEPLANE Return intersection point between a plane and a edge.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
intersectLineCylinder


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1464
INTERSECTLINECYLINDER Compute intersection points between a line and a cylinder.

   POINTS = intersectLineCylinder(LINE, CYLINDER)
   Returns intersection points between a line and a cylinder.

   Input parameters:
   LINE     = [x0 y0 z0  dx dy dz]
   CYLINDER = [x1 y1 z1 x2 y2 z2 R]

   Output:
   POINTS   = [x1 y1 z1 ; x2 y2 z2]

   POINTS = intersectLineCylinder(LINE, CYLINDER, 'checkBounds', B)
   Where B is a boolean (TRUE by default), check if the points are within
   the bounds defined by the two extreme points. If B is false, the
   cylinder is considered to be infinite.

   Example
     % Compute intersection between simple vertical cylinder and line
     line = [60 60 60 1 2 3];
     cylinder = [20 50 50 80 50 50 30];
     points = intersectLineCylinder(line, cylinder);
     % Display the different shapes
     figure;
     drawCylinder(cylinder);
     hold on; light;
     axis([0 100 0 100 0 100]);
     drawLine3d(line);
     drawPoint3d(points, 'ko');
     

     % Compute intersections when one of the points is outside the
     % cylinder
     line = [80 60 60 1 2 3];
     cylinder = [20 50 50 80 50 50 30];
     intersectLineCylinder(line, cylinder)
     ans = 
           67.8690   35.7380   23.6069

   
   See also
   lines3d, intersectLinePlane, drawCylinder, cylinderSurfaceArea

   References
   See the link:
   http://www.gamedev.net/community/forums/topic.asp?topic_id=467789




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
INTERSECTLINECYLINDER Compute intersection points between a line and a cylind...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
intersectLinePlane


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1080
INTERSECTLINEPLANE Intersection point between a 3D line and a plane.

   PT = intersectLinePlane(LINE, PLANE)
   Returns the intersection point of the given line and the given plane.
   LINE:  [x0 y0 z0 dx dy dz]
   PLANE: [x0 y0 z0 dx1 dy1 dz1 dx2 dy2 dz2]
   PT:    [xi yi zi]
   If LINE and PLANE are parallel, return [NaN NaN NaN].
   If LINE (or PLANE) is a matrix with 6 (or 9) columns and N rows, result
   is an array of points with N rows and 3 columns.
   
   PT = intersectLinePlane(LINE, PLANE, TOL)
   Specifies the tolerance factor to test if a line is parallel to a
   plane. Default is 1e-14.

   Example
     % define horizontal plane through origin
     plane = [0 0 0   1 0 0   0 1 0];
     % intersection with a vertical line
     line = [2 3 4  0 0 1];
     intersectLinePlane(line, plane)
     ans = 
        2   3   0
     % intersection with a line "parallel" to plane
     line = [2 3 4  1 2 0];
     intersectLinePlane(line, plane)
     ans = 
       NaN  NaN  NaN

   See also:
   lines3d, planes3d, points3d, clipLine3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
INTERSECTLINEPLANE Intersection point between a 3D line and a plane.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
intersectLinePolygon3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1494
INTERSECTLINEPOLYGON3D Intersection point of a 3D line and a 3D polygon.

   INTER = intersectLinePolygon3d(LINE, POLY)
   Compute coordinates of intersection point between the 3D line LINE and
   the 3D polygon POLY. LINE is a 1-by-6 row vector containing origin and
   direction vector of the line, POLY is a Np-by-3 array containing
   coordinates of 3D polygon vertices.
   INTER is a 1-by-3 row vector containing coordinates of intersection
   point, or [NaN NaN NaN] if line and polygon do not intersect.

   INTERS = intersectLinePolygon3d(LINES, POLY)
   If LINES is a N-by-6 array representing several lines, the result
   INTERS is a N-by-3 array containing coordinates of intersection of each
   line with the polygon.

   [INTER INSIDE] = intersectLinePolygon3d(LINE, POLY)
   Also return a N-by-1 boolean array containing TRUE if the corresponding
   polygon contains the intersection point.

   Example
     % Compute intersection between a 3D line and a 3D triangle
     pts3d = [3 0 0; 0 6 0;0 0 9];
     line1 = [0 0 0 3 6 9];
     inter = intersectLinePolygon3d(line1, pts3d)
     inter =
           1   2   3

     % keep only valid intersections with several lines
     pts3d = [3 0 0; 0 6 0;0 0 9];
     lines = [0 0 0 1 2 3;10 0 0 1 2 3];
     [inter inside] = intersectLinePolygon3d(line1, pts3d);
     inter(inside, :)
     ans = 
           1   2   3

   See Also
   intersectLinePolygon, intersectRayPolygon3d, intersectLinePlane




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 72
INTERSECTLINEPOLYGON3D Intersection point of a 3D line and a 3D polygon.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
intersectLineSphere


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1347
INTERSECTLINESPHERE Return intersection points between a line and a sphere.

   PTS = intersectLineSphere(LINE, SPHERE);
   Returns the two points which are the intersection of the given line and
   sphere. 
   LINE   : [x0 y0 z0  dx dy dz]
   SPHERE : [xc yc zc  R]
   PTS     : [x1 y1 z1 ; x2 y2 z2]
   If there is no intersection between the line and the sphere, return a
   2-by-3 array containing only NaN.

   Example
     % draw the intersection between a sphere and a collection of parallel
     % lines 
     sphere = [50.12 50.23 50.34 40];
     [x, y] = meshgrid(10:10:90, 10:10:90);
     n = numel(x);
     lines = [x(:) y(:) zeros(n,1) zeros(n,2) ones(n,1)];
     figure; hold on; axis equal;
     axis([0 100 0 100 0 100]); view(3);
     drawSphere(sphere);
     drawLine3d(lines);
     pts = intersectLineSphere(lines, sphere);
     drawPoint3d(pts, 'rx');

     % apply rotation on set of lines to check with non vertical lines
     rot = eulerAnglesToRotation3d(20, 30, 10);
     rot2 = recenterTransform3d(rot, [50 50 50]);
     lines2 = transformLine3d(lines, rot2);
     figure; hold on; axis equal;
     axis([0 100 0 100 0 100]); view(3);
     drawSphere(sphere);
     drawLine3d(lines2);
     pts2 = intersectLineSphere(lines2, sphere);
     drawPoint3d(pts, 'rx');

   See also
   spheres, circles3d, intersectPlaneSphere




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 75
INTERSECTLINESPHERE Return intersection points between a line and a sphere.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
intersectLineTriangle3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1419
INTERSECTLINETRIANGLE3D Intersection point of a 3D line and a 3D triangle.

   POINT = intersectLineTriangle3d(LINE, TRI)
   Compute coordinates of the intersection point between the line LINE and
   the triangle TRI.
   LINE is a 1-by-6 row vector given as: [X0 Y0 Z0 DX DY DZ]
   TRI is given either as a row vector [X1 Y1 Z1 X2 Y2 Z2 X3 Y3 Z3], or as
   a 3-by-3 array, each row containing coordinates of one of the triangle
   vertices.
   The result is a 1-by-3 array containing coordinates of the intesection
   point, or [NaN NaN NaN] if the line and the triangle do not intersect.

   [POINT POS] = intersectLineTriangle3d(LINE, TRI)
   Also returns the position of the intersection point on the line, or NaN
   if the line and the supporting plane of the triangle are parallel.

   [POINT POS ISINSIDE] = intersectLineTriangle3d(LINE, TRI)
   Also returns a boolean value, set to true if the line and the triangle
   intersect each other. Can be used for testing validity of result.

   Example
     line = [1 1 0 0 0 1];
     tri = [0 0 5;5 0 0;0 5 0];
     intersectLineTriangle3d(line, tri)
     ans = 
         1   1   3

   See also
   points3d, lines3d, polygons3d, intersectRayPolygon3d,
   distancePointTriangle3d

   References
   Algorithm adapted from SoftSurfer Ray/Segment-Triangle intersection
   http://softsurfer.com/Archive/algorithm_0105/algorithm_0105.htm




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 74
INTERSECTLINETRIANGLE3D Intersection point of a 3D line and a 3D triangle.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
intersectPlaneSphere


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1101
INTERSECTPLANESPHERE Return intersection circle between a plane and a sphere.

   CIRC = intersectPlaneSphere(PLANE, SPHERE)
   Returns the circle which is the intersection of the given plane
   and sphere. 
   PLANE  : [x0 y0 z0  dx1 dy1 dz1  dx2 dy2 dz2]
   SPHERE : [XS YS ZS  RS]
   CIRC   : [XC YC ZC  RC  THETA PHI PSI]
   [x0 y0 z0] is the origin of the plane, [dx1 dy1 dz1] and [dx2 dy2 dz2]
   are two direction vectors,
   [XS YS ZS] are coordinates of the sphere center, RS is the sphere
   radius, 
   [XC YC ZC] are coordinates of the circle center, RC is the radius of
   the circle, [THETA PHI] is the normal of the plane containing the
   circle (THETA being the colatitude, and PHI the azimut), and PSI is a
   rotation angle around the normal (equal to zero in this function, but
   kept for compatibility with other functions). All angles are given in
   degrees.
   
   See Also:
   planes3d, spheres, circles3d, intersectLinePlane, intersectLineSphere

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 18/02/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 77
INTERSECTPLANESPHERE Return intersection circle between a plane and a sphere.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
intersectPlanes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 487
INTERSECTPLANES Return intersection line between 2 planes in space.

   LINE = intersectPlanes(PLANE1, PLANE2)
   Returns the straight line belonging to both planes.
   PLANE:  [x0 y0 z0  dx1 dy1 dz1  dx2 dy2 dz2]
   LINE:   [x0 y0 z0  dx dy dz]
   In case of parallel planes, returns line with NaN values.

   LINE = intersectPlanes(PLANE1, PLANE2, TOL)
   Also specifies the tolerance for detecting parallel planes.

   See also:
   planes3d, lines3d, intersectLinePlane




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 67
INTERSECTPLANES Return intersection line between 2 planes in space.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
intersectRayPolygon3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1503
INTERSECTRAYPOLYGON3D Intersection point of a 3D ray and a 3D polygon.

   INTER = intersectRayPolygon3d(RAY, POLY)
   Compute coordinates of intersection point between the 3D ray RAY and
   the 3D polygon POLY. RAY is a 1-by-6 row vector containing origin and
   direction vector of the ray, POLY is a Np-by-3 array containing
   coordinates of 3D polygon vertices.
   INTER is a 1-by-3 row vector containing coordinates of intersection
   point, or [NaN NaN NaN] if ray and polygon do not intersect.

   INTERS = intersectRayPolygon3d(RAYS, POLY)
   If RAYS is a N-by-6 array representing several rays, the result
   INTERS is a N-by-3 array containing coordinates of intersection of each
   ray with the polygon.

   [INTER INSIDE] = intersectRayPolygon3d(RAY, POLY)
   Also return a N-by-1 boolean array containing TRUE if both the polygon
   and the corresponding ray contain the intersection point.

   Example
     % Compute intersection between a 3D ray and a 3D triangle
     pts3d = [3 0 0; 0 6 0;0 0 9];
     ray1 = [0 0 0 3 6 9];
     inter = intersectRayPolygon3d(ray1, pts3d)
     inter =
           1   2   3

     % keep only valid intersections with several rays
     pts3d = [3 0 0; 0 6 0;0 0 9];
     rays = [0 0 0 3 6 9;10 0 0 1 2 3;3 6 9 3 6 9];
     [inter inside] = intersectRayPolygon3d(rays, pts3d);
     inter(inside, :)
     ans = 
           1   2   3

   See Also
   intersectRayPolygon, intersectLinePolygon3d, intersectLineTriangle3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
INTERSECTRAYPOLYGON3D Intersection point of a 3D ray and a 3D polygon.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
intersectThreePlanes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 604
INTERSECTTHREEPLANES Return intersection point between 3 planes in space.

   LINE = intersectThreePlanes(PLANE1, PLANE2, PLANE3)
   Returns the point or straight line belonging to three planes.
   PLANE:  [x0 y0 z0  dx1 dy1 dz1  dx2 dy2 dz2]
   POINT:  [x0 y0 z0]
   IF rank of the coefficient matrix r1 = 3 and
   Rank of the augmented matrix r2 = 3 return point
   Otherwise returns point with NaN values.

   See also:
   planes3d, intersectPlanes, intersectLinePlane

   ---------
   author : Roozbeh Geraili Mikola
   email  : roozbehg@berkeley.edu or roozbehg@live.com
   created the 09/20/2017.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 73
INTERSECTTHREEPLANES Return intersection point between 3 planes in space.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
isBelowPlane


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 661
ISBELOWPLANE Test whether a point is below or above a plane.

   BELOW = isBelowPlane(POINT, PLANE)
   where POINT is given as coordinate row vector [XP YP ZP], and PLANE is
   given as a row containing initial point and 2 direction vectors, 
   return TRUE if POINT lie below PLANE.

   Example
   isBelowPlane([1 1 1], createPlane([1 2 3], [1 1 1]))
   ans =
       1
   isBelowPlane([3 3 3], createPlane([1 2 3], [1 1 1]))
   ans =
       0

   See also
   planes3d, points3d, linePosition3d, planePosition

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2007-01-05
 Copyright 2007 INRA - BIA PV Nantes - MIAJ Jouy-en-Josas.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
ISBELOWPLANE Test whether a point is below or above a plane.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
isCoplanar


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 415
ISCOPLANAR Tests input points for coplanarity in 3-space.

 COPL = isCoplanar(PTS)
 Tests the coplanarity of the input points in array PTS. Input array must
 be 4-by-3, each row containing coordinate of one point.

 COPL = isCoplanar(PTS, TOLERANCE)
 Specifies the tolerance value used for checking coplanarity. Default is
 zero.
 
 
 Example: 
   iscoplanar([1 2 -2; -3 1 -14; -1 2 -6; 1 -2 -8], eps)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
ISCOPLANAR Tests input points for coplanarity in 3-space.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
isParallel3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 874
ISPARALLEL3D Check parallelism of two 3D vectors.

   B = isParallel3d(V1, V2)
   where V1 and V2 are 2 [1x3] arrays, returns 1 if the vectors are
   parallels, and 0 otherwise.

   Also works when V1 and V2 are two [Nx3] arrays with same number of
   rows. In this case, return a [Nx1] array containing 1 at the positions
   of parallel vectors.

   Also works when one of V1 or V2 is scalar and the other one is [Nx3]
   array, in this case return [Nx1] results.

   B = isPerpendicular3d(V1, V2, TOL)
   Specifies the absolute tolerance (default is 1e-14).

   Example
   isParallel3d([1 2 1], [2 4 2])
   ans =
       1

   isParallel3d([1 2 1], [1 3 2])
   ans =
       0

   See also
   vectors3d, isPerpendicular3d

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2006-04-25
 Copyright 2006 INRA - CEPIA Nantes - MIAJ (Jouy-en-Josas).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
ISPARALLEL3D Check parallelism of two 3D vectors.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
isPerpendicular3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 893
ISPERPENDICULAR3D Check orthogonality of two 3D vectors.

   B = isPerpendicular3d(V1, V2)
   where V1 and V2 are 2 [1x3] arrays, returns 1 if the vectors are
   orthogonal, and 0 otherwise.

   Also works when V1 and V2 are two [Nx3] arrays with same number of
   rows. In this case, return a [Nx1] array containing 1 at the positions
   of parallel vectors.

   Also works when one of V1 or V2 is scalar and the other one is [Nx3]
   array, in this case return [Nx1] results.

   B = isPerpendicular3d(V1, V2, TOL)
   Specifies the absolute tolerance (default is 1e-14).


   Example
   isPerpendicular3d([1 0 0], [0 1 0])
   ans =
       1

   isPerpendicular3d([1 0 1], [1 0 0])
   ans =
       0

   See also
   vectors3d, isParallel3d

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2006-04-25
 Copyright 2006 INRA - CEPIA Nantes - MIAJ (Jouy-en-Josas).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
ISPERPENDICULAR3D Check orthogonality of two 3D vectors.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
isPlane


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 405
ISPLANE Check if input is a plane.

   B = isPlane(PLANE) where PLANE should be a plane or multiple planes

   Example
     isPlane([...
         0 0 0 1 0 0 0 1 0;...
         0 0 0 1 0 0 -1 0 0;...
         0 0 0 1i 0 0 -1 0 0;...
         0 0 0 nan 0 0 0 1 0;...
         0 0 0 inf 0 0 0 1 0])

   See also
   createPlane3d

 ------
 Author: oqilipo, David Legland
 Created: 2017-07-09
 Copyright 2017



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ISPLANE Check if input is a plane.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
isPointOnLine3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 565
ISPOINTONLINE3D Test if a 3D point belongs to a 3D line.

   B = isPointOnLine3d(POINT, LINE)
   with POINT being [xp yp zp], and LINE being [x0 y0 z0 dx dy dz].
   Returns 1 if point lies on the line, 0 otherwise.

   If POINT is an N-by-3 array of points, B is a N-by-1 array of booleans.

   If LINE is a N-by-6 array of lines, B is a N-by-1 array of booleans.

   B = isPointOnLine3d(POINT, LINE, TOL)
   Specifies the tolerance used for testing location on 3D line.

   See also: 
   lines3d, distancePointLine3d, linePosition3d, isPointOnLine




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
ISPOINTONLINE3D Test if a 3D point belongs to a 3D line.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
isTransform3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 959
ISTRANSFORM3D Check if input is a affine transformation matrix.

   A = isTransform3d(TRANS) where TRANS should be a transformation matrix.
   The function accepts transformations given using the following formats:
   [a b c]   ,   [a b c j] , or  [a b c j]
   [d e f]       [d e f k]       [d e f k]
   [g h i]       [g h i l]       [g h i l]
                                 [0 0 0 1]
   
   If the transformation matrix should only contain rotation and
   translation without reflection, scaling, shearing, ... set 'rotation'
   to true. Default is false.

   Example
     rot = ...
         createRotationOx(rand*2*pi)*...
         createRotationOy(rand*2*pi)*...
         createRotationOx(rand*2*pi);
     trans = rot*createTranslation3d(rand(1,3));
     isTransform3d(trans, 'rot', true)

   See also
   composeTransforms3d, createBasisTransform3d, recenterTransform3d,
   transformPoint3d

 ------
 Author: oqilipo
 Created: 2018-07-08
 Copyright 2018



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
ISTRANSFORM3D Check if input is a affine transformation matrix.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
linePosition3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 972
LINEPOSITION3D Return the position of a 3D point projected on a 3D line.

   T = linePosition3d(POINT, LINE)
   Computes position of point POINT on the line LINE, relative to origin
   point and direction vector of the line.
   LINE has the form [x0 y0 z0 dx dy dy],
   POINT has the form [x y z], and is assumed to belong to line.
   The result T is the value such that POINT = LINE(1:3) + T * LINE(4:6).
   If POINT does not belong to LINE, the position of its orthogonal
   projection is computed instead. 

   T = linePosition3d(POINT, LINES)
   If LINES is an array of NL lines, return NL positions, corresponding to
   each line.

   T = linePosition3d(POINTS, LINE)
   If POINTS is an array of NP points, return NP positions, corresponding
   to each point.

   See also:
   lines3d, createLine3d, distancePointLine3d, projPointOnLine3d

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 17/02/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 72
LINEPOSITION3D Return the position of a 3D point projected on a 3D line.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
lineToEdge3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 493
LINETOEDGE3D Convert a 3D straight line to a 3D finite edge.

   EDGE = lineToEdge3d(LINE)
   Returns the edge with same origin as the line LINE, and with second
   extremity corresponding to the addition of line origin and direction.
   LINE is represented as [X0 Y0 Z0  DX DY DZ]
   EDGE is represented as [X1 Y1 Z1  X2 Y2 Z2]

   Example
     line = [3 4 5  1 2 3];
     edge = lineToEdge3d(line)
     edge =
          3   4   5   4   6   8

   See also
     lines3d, edges3d, edgeToLine3d



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
LINETOEDGE3D Convert a 3D straight line to a 3D finite edge.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
lines3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 468
LINES3D Description of functions operating on 3D lines.

   A 3D Line is represented by a 1-by-6 row vector containing a 3D point
   (its origin) and a 3D vector (its direction):
   LINE = [X0 Y0 Z0 DX DY DZ];

   See also:
   createLine3d, distancePointLine3d, isPointOnLine3d, linePosition3d 
   intersectLinePlane, distanceLines3d, parallelLine3d, projPointOnLine3d
   clipLine3d, fitLine3d, drawLine3d, transformLine3d
   edgeToLine3d, lineToEdge3d
   



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
LINES3D Description of functions operating on 3D lines.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
medianPlane


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 458
MEDIANPLANE Create a plane in the middle of 2 points.

   PLANE = medianPlane(P1, P2)
   Creates a plane in the middle of 2 points.
   PLANE is perpendicular to line (P1 P2) and contains the midpoint of P1
   and P2.
   The direction of the normal of PLANE is the same as the vector from P1
   to P2.

   See also:
   planes3d, createPlane

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 18/02/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
MEDIANPLANE Create a plane in the middle of 2 points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
mergeBoxes3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 481
MERGEBOXES3D Merge 3D boxes, by computing their greatest extent.

   BOX = mergeBoxes3d(BOX1, BOX2);

   Example
   box1 = [5 20 5 30 10 50];
   box2 = [0 15 0 15 0 20];
   mergeBoxes3d(box1, box2)
   ans = 
       0 20 0 30 0 50


   See also
   boxes3d, drawBox3d, intersectBoxes3d


 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2010-07-26,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
MERGEBOXES3D Merge 3D boxes, by computing their greatest extent.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
midPoint3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 989
MIDPOINT3D Middle point of two 3D points or of a 3D edge.

   MID = midPoint3d(P1, P2)
   Compute the middle point of the two points P1 and P2.

   MID = midPoint3d(EDGE)
   Compute the middle point of the edge given by EDGE.
   EDGE has the format: [X1 Y1 Z1 X2 Y2 Z2], and MID has the format 
   [XMID YMID ZMID], 
   with XMID = (X1+X2)/2, YMID = (Y1+Y2)/2 and ZMID = (Z1+Z2)/2.

   [MIDX MIDY] = midPoint3d(...)
   Return the result as two separate variables or arrays.

   Works also when EDGE is a N-by-6 array, in this case the result is a
   N-by-3 array containing the midPoint3d of each edge.


   Example
   P1 = [10 20 30];
   P2 = [30 40 50];
   % edge input
   midPoint3d([P1 P2])
   ans =
       20  30  40

   % two points input
   midPoint3d(P1, P2)
   ans =
       20  30  40

   % three outputs
   [xm ym zm] = midPoint3d(P1, P2)
   xm =
       20  
   ym = 
       30  
   zm = 
       40

   See also
     edges3d, points3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
MIDPOINT3D Middle point of two 3D points or of a 3D edge.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
normalizePlane


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 746
NORMALIZEPLANE Normalize parametric representation of a plane.

   PLANE2 = normalizePlane(PLANE1);
   Transforms the plane PLANE1 in the following format:
   [X0 Y0 Z0  DX1 DY1 DZ1  DX2 DY2 DZ2], where:
   - (X0, Y0, Z0) is a point belonging to the plane
   - (DX1, DY1, DZ1) is a first direction vector
   - (DX2, DY2, DZ2) is a second direction vector
   into another plane, with the same format, but with:
   - (x0 y0 z0) is the closest point of plane to the origin
   - (DX1 DY1 DZ1) has norm equal to 1
   - (DX2 DY2 DZ2) has norm equal to 1 and is orthogonal to (DX1 DY1 DZ1)
   
   See also:
   planes3d, createPlane

   ---------
   author: David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 21/02/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
NORMALIZEPLANE Normalize parametric representation of a plane.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
normalizeVector3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 341
NORMALIZEVECTOR3D Normalize a 3D vector to have norm equal to 1.

   V2 = normalizeVector3d(V);
   Returns the normalization of vector V, such that ||V|| = 1. Vector V is
   given as a row vector.

   If V is a N-by-3 array, normalization is performed for each row of the
   input array.

   See also:
   vectors3d, vectorNorm3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
NORMALIZEVECTOR3D Normalize a 3D vector to have norm equal to 1.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
oblateSurfaceArea


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 201
OBLATESURFACEAREA  Approximated surface area of an oblate ellipsoid.

   S = oblateSurfaceArea(R1,R2)

   Example
   oblateSurfaceArea

   See also
   geom3d, ellipsoidSurfaceArea, prolateSurfaceArea




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
OBLATESURFACEAREA  Approximated surface area of an oblate ellipsoid.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
orientedBox3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 470
ORIENTEDBOX3D Object-oriented bounding box of a set of 3D points.

   OOBB = orientedBox3d(PTS)

   Example
     [v, f] = sphereMesh;
     rotMat = eulerAnglesToRotation3d(30, 20, 10);
     pts = transformPoint3d(bsxfun(@times, v, [5 3 1]), rotMat);
     box3d = orientedBox3d(pts);
     figure; drawPoint3d(pts, '.'); hold on;
     axis equal; axis([-6 6 -6 6 -5 5]);
     h = drawCuboid(box3d);
     set(h, 'facecolor', 'none');

   See also
     meshes3d, drawCuboid



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
ORIENTEDBOX3D Object-oriented bounding box of a set of 3D points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
parallelLine3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 424
PARALLELLINE3D  Create 3D line parallel to another one.

   L2 = parallelLine3d(L, P)
   Creates the 3D line L2, parallel to the line L, and containing the
   point P.

   Example

   See also
   geom3d, parallelLine, parallelPlane

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2012-08-23,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2012 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
PARALLELLINE3D  Create 3D line parallel to another one.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
parallelPlane


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1030
PARALLELPLANE Parallel to a plane through a point or at a given distance.

   PL2 = parallelPlane(PL, PT)
   Constructs the plane parallel to plane PL and containing the point PT.

   PL2 = parallelPlane(PL, D)
   Constructs the plane parallel to plane PL, and located at the given
   signed distance D.

   Example
     % Create a plane normal to the 3D vector DIR
     dir = [3 4 5];
     plane = createPlane([3 4 5], dir);
     % Create plane at a specific distance 
     plane2 = parallelPlane(plane, 5);
     % Create a line perpendicular to both planes
     line = [2 4 1 3 4 5];
     pi1 = intersectLinePlane(line, plane);
     pi2 = intersectLinePlane(line, plane2);
     % check the distance between intersection points
     distancePoints3d(pi1, pi2)
     ans = 
         5

   See also
   geom3d, parallelLine3d

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2012-08-22,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2012 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 73
PARALLELPLANE Parallel to a plane through a point or at a given distance.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
planeNormal


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 235
PLANENORMAL Compute the normal to a plane.

   N = planeNormal(PLANE) 
   compute the normal of the given plane
   PLANE : [x0 y0 z0 dx1 dy1 dz1 dx2 dy2 dz2]
   N : [dx dy dz]
   
   See also
   geom3d, planes3d, createPlane




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
PLANENORMAL Compute the normal to a plane.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
planePoint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 465
PLANEPOINT Compute 3D position of a point in a plane.

   POINT = planePoint(PLANE, POS)
   PLANE is a 9 element row vector [x0 y0 z0 dx1 dy1 dz1 dx2 dy2 dz2]
   POS is the coordinate of a point in the plane basis,
   POINT is the 3D coordinate in global basis.

   Example
     plane = [10 20 30  1 0 0  0 1 1];
     pos2d = [3 4];
     pt = planePoint(plane, pos2d)
     pt = 
           13  24   34

   See also
   geom3d, planes3d, planePosition



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
PLANEPOINT Compute 3D position of a point in a plane.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
planePosition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 756
PLANEPOSITION Compute position of a point on a plane.

   PT2 = planePosition(POINT, PLANE)
   POINT has format [X Y Z], and plane has format
   [X0 Y0 Z0  DX1 DY1 DZ1  DX2 DY2 DZ2], where :
   - (X0, Y0, Z0) is a point belonging to the plane
   - (DX1, DY1, DZ1) is a first direction vector
   - (DX2, DY2, DZ2) is a second direction vector

   Result PT2 has the form [XP YP], with [XP YP] coordinate of the point
   in the coordinate system of the plane.

   
   CAUTION:
   WORKS ONLY FOR PLANES WITH ORTHOGONAL DIRECTION VECTORS

   Example
     plane = [10 20 30  1 0 0  0 1 0];
     point = [13 24 35];
     pos = planePosition(point, plane)
     pos = 
         3   4

   See also:
   geom3d, planes3d, points3d, planePoint



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
PLANEPOSITION Compute position of a point on a plane.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
planes3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 577
PLANES3D Description of functions operating on 3D planes.

   Planes are represented by a 3D point (the plane origin) and 2 direction
   vectors, which should not be colinear.
   PLANE = [X0 Y0 Z0  DX1 DY1 DZ1  DX2 DY2 DZ2];

   See also
   createPlane, normalizePlane, medianPlane, planeNormal, parallelPlane
   distancePointPlane, projPointOnPlane, planePosition, isBelowPlane
   intersectPlanes, intersectLinePlane, intersectEdgePlane
   dihedralAngle, planesBisector, polyhedronSlice, clipConvexPolyhedronHP
   fitPlane, drawPlane3d, transformPlane3d, isPlane




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
PLANES3D Description of functions operating on 3D planes.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
planesBisector


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 996
 PLANESBISECTOR  Bisector plane between two other planes.
 
   BIS = planesBisector(PL1, PL2);
   Returns the planes that contains the intersection line between PL1 and
   PL2 and that bisect the dihedral angle of PL1 and PL2. 
   Note that computing the bisector of PL2 and PL1 (in that order) returns
   the same plane but with opposite orientation.

   Example
     % Draw two planes together with their bisector
     pl1 = createPlane([3 4 5], [1 2 3]);
     pl2 = createPlane([3 4 5], [2 -3 4]);
     % compute bisector
     bis = planesBisector(pl1, pl2);
     % setup display
     figure; hold on; axis([0 10 0 10 0 10]);
     set(gcf, 'renderer', 'opengl')
     view(3);
     % draw the planes
     drawPlane3d(pl1, 'g');
     drawPlane3d(pl2, 'g');
     drawPlane3d(bis, 'b');

   See also
   planes3d, dihedralAngle, intersectPlanes

   Author: Ben X. Kang
   Dept. Orthopaedics & Traumatology
   Li Ka Shing Faculty of Medicine
   The University of Hong Kong
   Pok Fu Lam, Hong Kong




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
 PLANESBISECTOR  Bisector plane between two other planes.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
points3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 591
POINTS3D Description of functions operating on 3D points.

   Points are represented by their 3 Cartesian coordinates:
   P = [X Y Z];

   Arrays of points consist in N*3 arrays, each row being a point.

   See also
   isCoplanar, distancePoints, boundingBox3d
   anglePoints3d, angleSort3d, sphericalAngle
   sph2cart2, cart2sph2, cart2cyl, cyl2cart
   transformPoint3d, clipPoints3d


 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2008-10-13,    using Matlab 7.4.0.287 (R2007a)
 Copyright 2008 INRA - BIA PV Nantes - MIAJ Jouy-en-Josas.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
POINTS3D Description of functions operating on 3D points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
polygon3dNormalAngle


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 886
POLYGON3DNORMALANGLE Normal angle at a vertex of the 3D polygon.

   THETA = polygon3DNormalAngle(POLYGON, IND)
   where POLYGON is a set of points, and IND is index of a point in
   polygon. The function compute the angle of the normal cone localized at
   this vertex.
   If IND is a vector of indices, normal angle is computed for each vertex
   specified by IND.

   Example
   % create an equilateral triangle in space
   poly3d = [1 1 0;-1 0 1;0 -1 -1];
   % compute each normal angle
   theta = polygon3dNormalAngle(poly3d, 1:size(poly3d, 1));
   % sum of normal angles must be equal to 2*PI for simple polygons
   sum(theta)

   IMPORTANT NOTE: works only for convex angles ! ! ! !

   See also
   polygons3d, faceNormalAngle

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2005-11-30
 Copyright 2005 INRA - CEPIA Nantes - MIAJ (Jouy-en-Josas).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
POLYGON3DNORMALANGLE Normal angle at a vertex of the 3D polygon.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
polygonArea3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 651
POLYGONAREA3D Area of a 3D polygon.

   AREA = polygonArea3d(POLY)
   POLY is given as a N-by-3 array of vertex coordinates. The resulting
   area is positive.
   Works also for polygons given as a cell array of polygons.

   Example
     % area of a simple 3D square 
     poly = [10 30 20;20 30 20;20 40 20;10 40 20];
     polygonArea3d(poly)
     ans =
        100

     % Area of a 3D mesh
     [v f] = createCubeOctahedron;
     polygons = meshFacePolygons(v, f);
     areas = polygonArea3d(polygons);
     sum(areas)
     ans =
         18.9282

   See also
     polygons3d, triangleArea3d, polygonArea, polygonCentroid3d



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
POLYGONAREA3D Area of a 3D polygon.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
polygonCentroid3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 599
POLYGONCENTROID3D Centroid (or center of mass) of a polygon.

   PTC = polygonCentroid3d(POLY)
   Computes center of mass of a polygon defined by POLY. POLY is a N-by-3
   array of double containing coordinates of polygon vertices.

   PTC = polygonCentroid3d(VX, VY, VZ)
   Specifies vertex coordinates as three separate arrays.

   Example
     % compute centroid of a basic polygon
     poly = [0 0 0; 10 0 10;10 10 20;0 10 10];
     centro = polygonCentroid3d(poly)
     centro =
         5.0000    5.0000    10.0000

   See also
   polygons3d, polygonArea3d, polygonCentroid




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
POLYGONCENTROID3D Centroid (or center of mass) of a polygon.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
polygons3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 759
POLYGONS3D Description of functions operating on 3D polygons.

   A 3D polygon is simply a set of 3D points (called vertices) which are
   assumed to be located in the same plane.
   Several functions are provided for computing basic geometrical
   parameters (centroid, angles), or intersections with lines or planes.

   See also:
   polygonArea3d, triangleArea3d, polygonCentroid3d, polygon3dNormalAngle 
   intersectLinePolygon3d, intersectLineTriangle3d, intersectRayPolygon3d
   clipConvexPolygon3dHP
   drawPolygon3d, drawPolyline3d, fillPolygon3d

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2008-10-13,    using Matlab 7.4.0.287 (R2007a)
 Copyright 2008 INRA - BIA PV Nantes - MIAJ Jouy-en-Josas.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
POLYGONS3D Description of functions operating on 3D polygons.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
projLineOnPlane


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 836
PROJLINEONPLANE Return the orthogonal projection of a line on a plane.
 
   NEWLINE = PROJLINEONPLANE(LINE, PLANE) Returns the orthogonal
   projection of LINE or multiple lines on the PLANE.

   [..., ISORTHOGONAL] = PROJLINEONPLANE(LINE, PLANE) Also returns if the
   LINE is orthogonal to the PLANE.

   Example
     plane = [.1 .2 .3 .4 .5 .6 .7 .8 .9];
     lines = [0 .3 0 1 0 0;0  .5 .5 0 0 1;...
         .4 .1 .5 1 0 2;.2 .7 .1 0 1 0;...
         plane(1:3) planeNormal(plane)];
     [newLines, isOrthogonal] = projLineOnPlane(lines, plane);
     figure('color','w'); axis equal; view(3)
     drawLine3d(lines,'b')
     drawPlane3d(plane)
     drawLine3d(newLines(~isOrthogonal,:), 'r')

   See also:
   planes3d, lines3d, intersectLinePlane, projPointOnPlane

 ---------
 Author: oqilipo 
 Created: 2017-08-06
 Copyright 2017



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
PROJLINEONPLANE Return the orthogonal projection of a line on a plane.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
projPointOnLine3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 637
PROJPOINTONLINE3D Project a 3D point orthogonally onto a 3D line.

   PT2 = projPointOnLine3d(PT, LINE).
   Computes the (orthogonal) projection of 3D point PT onto the 3D line
   LINE. 
   
   Function works also for multiple points and lines. In this case, it
   returns multiple points.
   Point PT1 is a N-by-3 array, and LINE is a N-by-6 array.
   Result PT2 is a N-by-3 array, containing coordinates of orthogonal
   projections of PT1 onto lines LINE. 


   See also:
   projPointOnLine, distancePointLine3d

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 2012-08-23.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
PROJPOINTONLINE3D Project a 3D point orthogonally onto a 3D line.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
projPointOnPlane


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1129
PROJPOINTONPLANE Return the orthogonal projection of a point on a plane.

   PT2 = projPointOnPlane(PT1, PLANE);
   Compute the (orthogonal) projection of point PT1 onto the plane PLANE,
   given as [X0 Y0 Z0  VX1 VY1 VZ1  VX2 VY2 VZ2] (origin point, first
   direction vector, second directionvector).
   
   The function is fully vectorized, in that multiple points may be
   projected onto multiple planes in a single call, returning multiple
   points. With the exception of the second dimension (where
   SIZE(PT1,2)==3, and SIZE(PLANE,2)==9), each dimension of PT1 and PLANE
   must either be equal or one, similar to the requirements of BSXFUN. In
   basic usage, point PT1 is a [N*3] array, and PLANE is a [N*9] array
   (see createPlane for details). Result PT2 is a [N*3] array, containing
   coordinates of orthogonal projections of PT1 onto planes PLANE. In
   vectorised usage, PT1 is an [N*3*M*P...] matrix, and PLANE is an
   [X*9*Y...] matrix, where (N,X), (M,Y), etc, are either equal pairs, or
   one of the two is one.

   See also:
   planes3d, points3d, planePosition, intersectLinePlane



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 72
PROJPOINTONPLANE Return the orthogonal projection of a point on a plane.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
prolateSurfaceArea


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 203
PROLATESURFACEAREA  Approximated surface area of a prolate ellipsoid.

   S = prolateSurfaceArea(R1,R2)

   Example
   prolateSurfaceArea

   See also
   geom3d, ellipsoidSurfaceArea, oblateSurfaceArea




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
PROLATESURFACEAREA  Approximated surface area of a prolate ellipsoid.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
randomAngle3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 912
RANDOMANGLE3D Return a 3D angle uniformly distributed on unit sphere.

   usage
   [THETA PHI] = randomAngle3d
   Generate an angle unformly distributed on the surface of the unit
   sphere.

   "Mathematical" convention is used: theta is the colatitude (angle with
   vertical axis, 0 for north pole, +pi for south pole, pi/2 for points at
   equator) with z=0. 
   phi is the same as matlab cart2sph: angle from Ox axis, counted
   positively counter-clockwise.

   [THETA PHI] = randomAngle3d(N)
   generates N random angles (N is a scalar). The result is a N-by-2
   array.

   Example:
     % Draw some points on the surface of a sphere
     figure;
     drawSphere; hold on;
     drawPoint3d(pts, '.');
     axis equal;

   See also:
   angles3d, sph2cart2, cart2sph2

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 created the 18/02/2005.
 Copyright INRA - Cepia Software platform



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
RANDOMANGLE3D Return a 3D angle uniformly distributed on unit sphere.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
randomPointInBox3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 852
RANDOMPOINTINBOX3D Generate random point(s) within a 3D box.

   PTS = randomPointInBox3d(BOX)
   Generate a random point within the 3D box BOX. The result is a 1-by-3
   row vector.

   PTS = randomPointInBox3d(BOX, N)
   Generates N points within the box. The result is a N-by-3 array.

   BOX has the format:
   BOX = [XMIN XMAX YMIN YMAX ZMIN ZMAX].

   Example
     % draw points within a box
     box = [10 40 20 60 30 50];
     pts =  randomPointInBox3d(box, 500);
     figure(1); hold on;
     drawBox3d(box);
     drawPoint3d(pts, '.');
     axis('equal');
     axis([0 100 0 100 0 100]);
     view(3);

   See also
   points3d, boxes3d

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2011-06-27,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2011 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
RANDOMPOINTINBOX3D Generate random point(s) within a 3D box.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
recenterTransform3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 952
RECENTERTRANSFORM3D Change the fixed point of an affine 3D transform.

   TRANSFO2 = recenterTransform3d(TRANSFO, CENTER)
   where TRANSFO is a 4x4 transformation matrix, and CENTER is a 1x3 row
   vector, computes the new transformations that uses the same linear part
   (defined by the upper-left 3x3 corner of the transformation matrix) as
   the initial transform, and that will leave the point CENTER unchanged.

   

   Example
   % creating a re-centered rotation using:   
   rot1 = createRotationOx(pi/3);
   rot2 = recenterTransform3d(rot1, [3 4 5]);
   % will give the same result as:
   rot3 = createRotationOx([3 4 5], pi/3);
   

   See also
   transforms3d, createRotationOx, createRotationOy, createRotationOz
   createTranslation3d

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2010-07-27,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
RECENTERTRANSFORM3D Change the fixed point of an affine 3D transform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
registerPoints3dAffine


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 675
 Fit 3D affine transform using iterative algorithm.

   TRANS = registerPoints3dAffine(POINTS, TARGET)
   Computes the affine transform that maps the shape defines by POINTS
   onto the shape defined by the points TARGET. Both POINTS and TARGET are
   N-by-3 array of point coordinates, not necessarily the same size.
   The result TRANS is a 4-by-4 affine transform.

   TRANS = registerPoints3dAffine(POINTS, TARGET, NITER)
   Specifies the number of iterations for the algorithm.

   [TRANS, POINTS2] = registerPoints3dAffine(...)
   Also returns the set of transformed points.

   Example
     registerPoints3dAffine

   See also
     transforms3d, fitAffineTransform3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
 Fit 3D affine transform using iterative algorithm.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
reverseLine3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 487
REVERSELINE3D Return same 3D line but with opposite orientation.

   INVLINE = reverseLine(LINE);
   Returns the opposite line of LINE.
   LINE has the format [x0 y0 z0 dx dy dz], then INVLINE will have
   following parameters: [x0 y0 z0 -dx -dy -dz].

   See also:
   reverseLine, reversePlane


 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2012-05-24,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2012 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
REVERSELINE3D Return same 3D line but with opposite orientation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
reversePlane


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 387
REVERSEPLANE Return same 3D plane but with opposite orientation.

   IP = reversePlane(PLANE);
   Returns a plane contining the same ppints but with normal opposite to
   that of PLANE. 
   If PLANE has the format [x0 y0 z0 dx1 dy1 dz1 dx2 dy2 dz2], then IP
   will have following parameters: [x0 y0 z0 dx1 dy1 dz1 -dx2 -dy2 -dz2].

   See also:
   createPlane, reverseLine3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
REVERSEPLANE Return same 3D plane but with opposite orientation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
revolutionSurface


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1714
REVOLUTIONSURFACE Create a surface of revolution from a planar curve.

   usage 
   [X Y Z] = revolutionSurface(C1, C2, N);
   create the surface of revolution of parametrized function (xt, yt),
   with N+1 equally spaced slices, around the Oz axis.
   It assumed that C1 corresponds to the x coordinate, and that C2
   corresponds to the Oz coordinate.

   [X Y Z] = revolutionSurface(CURVE, N);
   is the same, but generating curve is given in a single parameter CURVE,
   which is a [Nx2] array of 2D points.

   [X Y Z] = revolutionSurface(..., THETA)
   where THETA is a vector, uses values of THETA for computing revolution
   angles.

   [X Y Z] = revolutionSurface(..., LINE);
   where LINE is a 1x4 array, specifes the revolution axis in the
   coordinate system of the curve. LINE is a row vector of 4 parameters,
   containing [x0 y0 dx dy], where (x0,y0) is the origin of the line and
   (dx,dy) is a direction vector of the line.
   The resulting revolution surface still has Oz axis as symmetry axis. It
   can be transformed using transformPoint3d function.
   Surface can be displayed using :
   H = surf(X, Y, Z);
   H is a handle to the created patch.

   revolutionSurface(...);
   by itself, directly shows the created patch.

   Example
   % draws a piece of torus
   circle = circleAsPolygon([10 0 3], 50);
   [x y z] = revolutionSurface(circle, linspace(0, 4*pi/3, 50));
   surf(x, y, z);
   axis equal;



   See also
       surf, transformPoint3d, drawSphere, drawTorus, drawEllipsoid
       surfature (on Matlab File Exchange)


   ------
   Author: David Legland
   e-mail: david.legland@grignon.inra.fr
   Created: 2004-04-09
   Copyright 2005 INRA - CEPIA Nantes - MIAJ Jouy-en-Josas.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
REVOLUTIONSURFACE Create a surface of revolution from a planar curve.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
rotation3dAxisAndAngle


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 962
ROTATION3DAXISANDANGLE Determine axis and angle of a 3D rotation matrix.

   [AXIS, ANGLE] = rotation3dAxisAndAngle(MAT)
   Where MAT is a 4-by-4 matrix representing a rotation, computes the
   rotation axis (containing the points that remain invariant under the
   rotation), and the rotation angle around that axis.
   AXIS has the format [DX DY DZ], constrained to unity, and ANGLE is the
   rotation angle in radians.

   Note: this method use eigen vector extraction. It would be more precise
   to use quaternions, see:
   http://www.mathworks.cn/matlabcentral/newsreader/view_thread/160945

   
   Example
     origin = [1 2 3];
     direction = [4 5 6];
     line = [origin direction];
     angle = pi/3;
     rot = createRotation3dLineAngle(line, angle);
     [axis angle2] = rotation3dAxisAndAngle(rot);
     angle2
     angle2 =
           1.0472

   See also
   transforms3d, vectors3d, angles3d, eulerAnglesToRotation3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 72
ROTATION3DAXISANDANGLE Determine axis and angle of a 3D rotation matrix.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
rotation3dToEulerAngles


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1145
ROTATION3DTOEULERANGLES Extract Euler angles from a rotation matrix.

   [PHI, THETA, PSI] = rotation3dToEulerAngles(MAT)
   Computes Euler angles PHI, THETA and PSI (in degrees) from a 3D 4-by-4
   or 3-by-3 rotation matrix.

   ANGLES = rotation3dToEulerAngles(MAT)
   Concatenates results in a single 1-by-3 row vector. This format is used
   for representing some 3D shapes like ellipsoids.

   ... = rotation3dToEulerAngles(MAT, CONVENTION)
   CONVENTION specifies the axis rotation sequence. 
   Supported conventions are: 'ZYX', 'ZYZ'. Default is 'ZYX'

   Example
   rotation3dToEulerAngles

   References
   Code from Graphics Gems IV on euler angles
   http://tog.acm.org/resources/GraphicsGems/gemsiv/euler_angle/EulerAngles.c
   Modified using explanations in:
   http://www.gregslabaugh.name/publications/euler.pdf

   See also
   transforms3d, rotation3dAxisAndAngle, createRotation3dLineAngle,
   eulerAnglesToRotation3d


 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2010-08-11,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
ROTATION3DTOEULERANGLES Extract Euler angles from a rotation matrix.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
sph2cart2


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 899
SPH2CART2 Convert spherical coordinates to cartesian coordinates.

   C = SPH2CART2(S)
   C = SPH2CART2(THETA, PHI)       (assume rho = 1)
   C = SPH2CART2(THETA, PHI, RHO)   
   [X, Y, Z] = SPH2CART2(THETA, PHI, RHO);

   S = [phi theta rho] (spherical coordinate).
   C = [X Y Z]  (cartesian coordinate)

   The following convention is used:
   THETA is the colatitude, in radians, 0 for north pole, +pi for south
   pole, pi/2 for points with z=0. 
   PHI is the azimuth, in radians, defined as matlab cart2sph: angle from
   Ox axis, counted counter-clockwise.
   RHO is the distance of the point to the origin.
   Discussion on choice for convention can be found at:
   http://www.physics.oregonstate.edu/bridge/papers/spherical.pdf

   See also:
   angles3d, cart2sph2, sph2cart, sph2cart2d

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 18/02/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
SPH2CART2 Convert spherical coordinates to cartesian coordinates.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
sph2cart2d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1014
SPH2CART2D Convert spherical coordinates to cartesian coordinates in degrees.

   C = SPH2CART2(THETA, PHI, RHO)
   C = SPH2CART2(THETA, PHI)       (assume rho = 1)
   C = SPH2CART2(S)
   [X, Y, Z] = SPH2CART2(THETA, PHI, RHO);

   S = [phi theta rho] (spherical coordinate).
   C = [X Y Z]  (cartesian coordinate)

   The following convention is used:
   THETA is the colatitude, in degrees, 0 for north pole, +180 degrees for
   south pole, +90 degrees for points with z=0. 
   PHI is the azimuth, in degrees, defined as matlab cart2sph: angle from
   Ox axis, counted counter-clockwise.
   RHO is the distance of the point to the origin.
   Discussion on choice for convention can be found at:
   http://www.physics.oregonstate.edu/bridge/papers/spherical.pdf

   See also:
   angles3d, cart2sph2d, sph2cart2

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2011-06-29,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2011 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 77
SPH2CART2D Convert spherical coordinates to cartesian coordinates in degrees.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
spheres


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 668
SPHERES Description of functions operating on 3D spheres.

   Spheres are represented by their center and their radius:
   S = [xc yc zc r];

   An ellipsoid is defined by:
   ELL = [XC YC ZC  A B C  PHI THETA PSI]
   where [XC YC ZY] is the center, [A B C] are length of semi-axes (in
   decreasing order), and [PHI THETA PSI] are euler angles representing
   the ellipsoid orientation.

   See also
   createSphere, equivalentEllipsoid
   intersectLineSphere, intersectPlaneSphere, sphericalVoronoiDomain
   drawSphere, drawEllipsoid, fillSphericalTriangle, fillSphericalPolygon
   drawSphericalEdge, drawSphericalTriangle, drawSphericalPolygon
   



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
SPHERES Description of functions operating on 3D spheres.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
sphericalAngle


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1268
SPHERICALANGLE Compute angle between points on the sphere.

   ALPHA = sphericalAngle(P1, P2, P3)
   Computes angle (P1, P2, P3), i.e. the angle, measured at point P2,
   between the direction (P2, P1) and the direction (P2, P3).
   The result is given in radians, between 0 and 2*PI.

   Points are given either as [x y z] (there will be normalized to lie on
   the unit sphere), or as [phi theta], with phi being the longitude in [0
   2*PI] and theta being the elevation on horizontal [-pi/2 pi/2].


   NOTE: 
   this is an 'oriented' version of the angle computation, that is, the
   result of sphericalAngle(P1, P2, P3) equals
   2*pi-sphericalAngle(P3,P2,P1). To have the more classical relation
   (with results given betwen 0 and PI), it suffices to take the minimum
   of angle and 2*pi-angle.
   
   Examples
     % Use inputs as cartesian coordinates   
     p1 = [0 1 0];
     p2 = [1 0 0];
     p3 = [0 0 1];
     alpha = sphericalAngle(p1, p2, p3)
     alpha =
         1.5708

     % Use inputs as spherical coordinates   
     sph1 = [.1 0];
     sph2 = [0 0];
     sph3 = [0 .1];
     alphas = sphericalAngle(sph1, sph2, sph3)
     alphas =
         1.5708
 

   See also:
   geom3d, angles3d, spheres, sph2cart



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
SPHERICALANGLE Compute angle between points on the sphere.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
sphericalVoronoiDomain


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 697
SPHERICALVORONOIDOMAIN Compute a spherical voronoi domain.

   POLY = sphericalVoronoiDomain(GERM, NEIGHBORS)
   GERM is a 1-by-3 row vector representing cartesian coordinates of a
   point on the unit sphere (in X, Y Z order)
   NEIGHBORS is a N-by-3 array representing cartesian coordinates of the
   germ neighbors. It is expected that NEIGHBORS contains only neighbors
   that effectively contribute to the voronoi domain.

   Example
   sphericalVoronoiDomain

   See also
   drawSphericalPolygon

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2010-11-17,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2010 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
SPHERICALVORONOIDOMAIN Compute a spherical voronoi domain.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
surfaceCurvature


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 213
SURFACECURVATURE Curvature on a surface from angle and principal curvatures.

   usage:
   KAPPA = surfaceCurvature(KAPPA1, KAPPA2, THETA)
   return the curvature KAPPA of surface with respect to direction THETA.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 76
SURFACECURVATURE Curvature on a surface from angle and principal curvatures.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
transformLine3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 670
TRANSFORMLINE3D Transform a 3D line with a 3D affine transform.

   LINE2 = transformLine3d(LINE1, TRANS)

   Example
   P1 = [10 20 30];
   P2 = [30 40 50];
   L = createLine3d(P1, P2);
   T = createRotationOx(P1, pi/6);
   L2 = transformLine3d(L, T);
   figure; hold on;
   axis([0 100 0 100 0 100]); view(3);
   drawPoint3d([P1;P2]);
   drawLine3d(L, 'b');
   drawLine3d(L2, 'm');

   See also:
   lines3d, transforms3d, transformPoint3d, transformVector3d

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2008-11-25,    using Matlab 7.7.0.471 (R2008b)
 Copyright 2008 INRA - BIA PV Nantes - MIAJ Jouy-en-Josas.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
TRANSFORMLINE3D Transform a 3D line with a 3D affine transform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
transformPlane3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 531
TRANSFORMPLANE3D Transform a 3D plane with a 3D affine transform.

   PLANE2 = transformPlane3d(PLANE, TRANS)

   Example
     p1 = [10 20 30];
     p2 = [30 40 50];
     p3 = [0 -10 -20];
     plane = createPlane(p1, p2, p3);
     rot = createRotationOx(p1, pi/6);
     plane2 = transformPlane3d(plane, rot);
     figure; hold on;
     axis([0 100 0 100 0 100]); view(3);
     drawPlane3d(plane, 'b');
     drawPlane3d(plane2, 'm');

   See also:
   lines3d, transforms3d, transformPoint3d, transformVector3d,
   transformLine3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
TRANSFORMPLANE3D Transform a 3D plane with a 3D affine transform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
transformPoint3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1454
TRANSFORMPOINT3D Transform a point with a 3D affine transform.

   PT2 = transformPoint3d(PT1, TRANS);
   PT2 = transformPoint3d(X1, Y1, Z1, TRANS);
   where PT1 has the form [xp yp zp], and TRANS is a [3x3], [3x4], [4x4]
   matrix, return the point transformed according to the affine transform
   specified by TRANS.

   Format of TRANS is a 4-by-4 matrix.

   The function accepts transforms given using the following formats:
   [a b c]   ,   [a b c j] , or [a b c j]
   [d e f]       [d e f k]      [d e f k]
   [g h i]       [g h i l]      [g h i l]
                                [0 0 0 1]

   PT2 = transformPoint3d(PT1, TRANS) 
   also work when PT1 is a [Nx3xMxPxETC] array of double. In this case, 
   PT2 has the same size as PT1.

   PT2 = transformPoint3d(X1, Y1, Z1, TRANS);
   also work when X1, Y1 and Z1 are 3 arrays with the same size. In this
   case, PT2 will be a 1-by-3 cell containing {X Y Z} outputs of size(X1).

   [X2 Y2 Z2] = transformPoint3d(...);
   returns the result in 3 different arrays the same size as the input.
   This form can be useful when used with functions like meshgrid or warp.
   
   MESH2 = transformPoint3d(MESH, TRANS) transforms the field 'vertices' 
   of the struct MESH and returns the same struct with the transformed
   vertices

   See also:
   points3d, transforms3d, translation3d, meshgrid

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 10/02/2005.




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
TRANSFORMPOINT3D Transform a point with a 3D affine transform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
transformVector3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1002
TRANSFORMVECTOR3D Transform a vector with a 3D affine transform.

   V2 = transformVector3d(V1, TRANS);
   Computes the vector obtained by transforming vector V1 with affine
   transform TRANS.
   V1 has the form [x1 y1 z1], and TRANS is a [3x3], [3x4], or [4x4]
   matrix, with one of the forms:
   [a b c]   ,   [a b c j] , or [a b c j]
   [d e f]       [d e f k]      [d e f k]
   [g h i]       [g h i l]      [g h i l]
                                [0 0 0 1]

   V2 = transformVector3d(V1, TRANS) also works when V1 is a [Nx3xMxEtc]
   array of double. In this case, V2 has the same size as V1.

   V2 = transformVector3d(X1, Y1, Z1, TRANS);
   Specifies vectors coordinates in three arrays with same size.

   [X2 Y2 Z2] = transformVector3d(...);
   Returns the coordinates of the transformed vector separately.


   See also:
   vectors3d, transforms3d, transformPoint3d

   ---------
   author : David Legland 
   INRA - TPV URPOI - BIA IMASTE
   created the 25/11/2008 from transformPoint3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
TRANSFORMVECTOR3D Transform a vector with a 3D affine transform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
transforms3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 844
TRANSFORMS3D  Conventions for manipulating 3D affine transforms.

   By 'transform' we mean an affine transform. A 3D affine transform
   is represented by a 4*4 matrix. The last row of the matrix is equal to
   [0 0 0 1].

   

   Example:
   % create a translation by the vector [10 20 30]:
   T = createTranslation3d([10 20 30]);
   % Transform a basic point:
   PT1 = [4 5 6];
   PT2 = transformPoint3d(PT1, T)
   % returns:
   PT2 = 
       14   25   36

   See also
   createTranslation3d, createScaling3d, , createBasisTransform3d
   createRotationOx, createRotationOy, createRotationOz
   rotation3dAxisAndAngle, rotation3dToEulerAngles,
   createRotation3dLineAngle, eulerAnglesToRotation3d
   transformPoint3d, transformVector3d, transformLine3d, transformPlane3d
   composeTransforms3d, recenterTransform3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
TRANSFORMS3D  Conventions for manipulating 3D affine transforms.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
triangleArea3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1058
TRIANGLEAREA3D Area of a 3D triangle.

   AREA = triangleArea3d(P1, P2, P3)
   Computes area of the 3D triangle whose vertices are given by P1, P2 and
   P3. Each vertex is either a 1-by-3 row vector, or an array with 3
   columns, each column representing coordinate of a vertex.
   The result AREA has as many rows as the number of rows of the largest
   input array.
   Compared to polygonArea3d, this function is assumed to be faster, as it
   does not requires iteration over vertices. Moreover, it can be used to
   computes the area of several triangles simultaneously.

   AREA = triangleArea3d(PTS)
   Concatenates vertex coordinates in a 3-by-3 array. Each row of the
   array contains coordinates of one vertex.


   Example
   triangleArea3d([10 10 10], [30 10 10], [10 40 10])
   ans = 
       300

   See also
   polygons3d, polygonArea3d

 ------
 Author: David Legland
 e-mail: david.legland@grignon.inra.fr
 Created: 2011-08-23,    using Matlab 7.9.0.529 (R2009b)
 Copyright 2011 INRA - Cepia Software Platform.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
TRIANGLEAREA3D Area of a 3D triangle.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
vectorAngle3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 489
VECTORANGLE3D Angle between two 3D vectors.

   THETA = vectorAngle3d(V1, V2)
   Computes the angle between the 2 3D vectors V1 and V2. The result THETA
   is given in radians, between 0 and PI.


   Example
   % angle between 2 orthogonal vectors
   vectorAngle3d([1 0 0], [0 1 0])
   ans = 
       1.5708

   % angle between 2 parallel vectors
   v0 = [3 4 5];
   vectorAngle3d(3*v0, 5*v0)
   ans = 
       0

   See also
   vectors3d, vectorNorm3d, crossProduct3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
VECTORANGLE3D Angle between two 3D vectors.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
vectorCross3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 571
VECTORCROSS3D Vector cross product faster than inbuilt MATLAB cross.

   C = vectorCross3d(A, B) 
   returns the cross product of the 3D vectors A and B, that is: 
       C = A x B
   A and B must be N-by-3 element vectors. If either A or B is a 1-by-3
   row vector, the result C will have the size of the other input and will
   be the  concatenation of each row's cross product. 

   Example
     v1 = [2 0 0];
     v2 = [0 3 0];
     vectorCross3d(v1, v2)
     ans =
         0   0   6


   Class support for inputs A,B:
      float: double, single

   See also DOT.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
VECTORCROSS3D Vector cross product faster than inbuilt MATLAB cross.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
vectorNorm3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 369
VECTORNORM3D Norm of a 3D vector or of set of 3D vectors.

   N = vectorNorm3d(V);
   Returns the norm of vector V.

   When V is a N-by-3 array, compute norm for each vector of the array.
   Vector are given as rows. Result is then a N-by-1 array.

   NOTE: compute only euclidean norm.

   See Also
   vectors3d, normalizeVector3d, vectorAngle3d, hypot3




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
VECTORNORM3D Norm of a 3D vector or of set of 3D vectors.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
vectors3d


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 410
VECTORS3D Description of functions operating on 3D vectors.

   Vectors are represented by their 3 Cartesian coordinates:
   V = [VX VY VZ];

   List of vectors are represented by N-by-3 arrays, with the coordinates
   of each vector on a row.


   See also
   vectorNorm3d, normalizeVector3d, crossProduct3d, vectorAngle3d
   isParallel3d, isPerpendicular3d, createTranslation3d
   drawVector3d




# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
VECTORS3D Description of functions operating on 3D vectors.





