]> Creatis software - CreaPhase.git/blob - octave_packages/geometry-1.5.0/geom2d/doc-cache
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / geometry-1.5.0 / geom2d / doc-cache
1 # Created by Octave 3.6.2, Sun Jun 10 09:53:43 2012 UTC <root@brouzouf>
2 # name: cache
3 # type: cell
4 # rows: 3
5 # columns: 117
6 # name: <cell-element>
7 # type: sq_string
8 # elements: 1
9 # length: 12
10 angle2Points
11
12
13 # name: <cell-element>
14 # type: sq_string
15 # elements: 1
16 # length: 411
17  -- Function File: ALPHA = angle2Points (P1, P2)
18      Compute horizontal angle between 2 points
19
20      P1 and P2 are either [1x2] arrays, or [Nx2] arrays, in this case
21      ALPHA is a [Nx1] array. The angle computed is the horizontal angle
22      of the line (P1,P2).
23
24      Result is always given in radians, between 0 and 2*pi.
25
26      See also: points2d, angles2d, angle3points, normalizeAngle,
27      vectorAngle
28
29
30
31
32
33 # name: <cell-element>
34 # type: sq_string
35 # elements: 1
36 # length: 42
37 Compute horizontal angle between 2 points
38
39
40
41
42 # name: <cell-element>
43 # type: sq_string
44 # elements: 1
45 # length: 12
46 angle3Points
47
48
49 # name: <cell-element>
50 # type: sq_string
51 # elements: 1
52 # length: 410
53  -- Function File: ALPHA = angle3Points (P1, P2, P3)
54      Computes the angle between the points P1, P2 and P3.
55
56      P1, P2 and P3 are either [1x2] arrays, or [Nx2] arrays, in this
57      case ALPHA is a [Nx1] array. The angle computed is the directed
58      angle between line (P2P1) and line (P2P3).
59
60      Result is always given in radians, between 0 and 2*pi.
61
62      See also: points2d, angles2d, angle2points
63
64
65
66
67
68 # name: <cell-element>
69 # type: sq_string
70 # elements: 1
71 # length: 52
72 Computes the angle between the points P1, P2 and P3.
73
74
75
76 # name: <cell-element>
77 # type: sq_string
78 # elements: 1
79 # length: 12
80 angleAbsDiff
81
82
83 # name: <cell-element>
84 # type: sq_string
85 # elements: 1
86 # length: 323
87  -- Function File: DIF = angleAbsDiff (ANGLE1, ANGLE2)
88      Computes the absolute angular difference between two angles in
89      radians.  The result is comprised between 0 and pi.
90
91               A = angleAbsDiff(pi/2, pi/3)
92               A =
93                   0.5236   % equal to pi/6
94
95      See also: angles2d, angleDiff
96
97
98
99
100
101 # name: <cell-element>
102 # type: sq_string
103 # elements: 1
104 # length: 71
105 Computes the absolute angular difference between two angles in radians.
106
107
108
109 # name: <cell-element>
110 # type: sq_string
111 # elements: 1
112 # length: 9
113 angleDiff
114
115
116 # name: <cell-element>
117 # type: sq_string
118 # elements: 1
119 # length: 421
120  -- Function File: DIF = angleDiff (ANGLE1, ANGLE2)
121      Difference between two angles
122
123      Computes the signed angular difference between two angles in
124      radians.    The result is comprised between -PI and +PI.
125
126      Example     A = angleDiff(-pi/4, pi/4)     A =         1.5708    %
127      equal to pi/2     A = angleDiff(pi/4, -pi/4)     A =
128      -1.5708    % equal to -pi/2
129
130      See also: angles2d, angleAbsDiff
131
132
133
134
135
136 # name: <cell-element>
137 # type: sq_string
138 # elements: 1
139 # length: 30
140 Difference between two angles
141
142
143
144
145 # name: <cell-element>
146 # type: sq_string
147 # elements: 1
148 # length: 9
149 angleSort
150
151
152 # name: <cell-element>
153 # type: sq_string
154 # elements: 1
155 # length: 665
156  -- Function File: varargout = angleSort (PTS, varargin)
157      Sort points in the plane according to their angle to origin
158
159      PTS2 = angleSort(PTS);   Computes angle of points with origin, and
160      sort points with increasing   angles in Counter-Clockwise
161      direction.
162
163      PTS2 = angleSort(PTS, PTS0);   Computes angles between each point
164      of PTS and PT0, which can be   different from origin.
165
166      PTS2 = angleSort(..., THETA0);   Specifies the starting angle for
167      sorting.
168
169      [PTS2, I] = angleSort(...);   Also returns in I the indices of
170      PTS, such that PTS2 = PTS(I, :);
171
172      See also: points2d, angles2d, angle2points, normalizeAngle
173
174
175
176
177
178 # name: <cell-element>
179 # type: sq_string
180 # elements: 1
181 # length: 60
182 Sort points in the plane according to their angle to origin
183
184
185
186
187 # name: <cell-element>
188 # type: sq_string
189 # elements: 1
190 # length: 8
191 angles2d
192
193
194 # name: <cell-element>
195 # type: sq_string
196 # elements: 1
197 # length: 620
198  -- Function File: angles2d ()
199      Description of functions for manipulating angles
200
201      Angles are normalized in an interval of width 2*PI. Most geom2d
202      functions return results in the [0 2*pi] interval, but it can be
203      convenient to consider the [-pi pi] interval as well. See the
204      normalizeAngle function to switch between conventions.
205
206      Angles are usually oriented. The default orientation is the CCW
207      (Counter-Clockwise) orientation.
208
209      See also: angle2Points, angle3Points, angleAbsDiff,
210      normalizeAngle, vectorAngle, angleDiff, angleSort, lineAngle,
211      edgeAngle, deg2rad, rad2deg
212
213
214
215
216
217 # name: <cell-element>
218 # type: sq_string
219 # elements: 1
220 # length: 49
221 Description of functions for manipulating angles
222
223
224
225
226 # name: <cell-element>
227 # type: sq_string
228 # elements: 1
229 # length: 11
230 beltproblem
231
232
233 # name: <cell-element>
234 # type: sq_string
235 # elements: 1
236 # length: 1316
237  -- Function File: [TANGENT,INNER] =  beltproblem (C, R)
238      Finds the four lines tangent to two circles with given centers and
239      radii.
240
241      The function solves the belt problem in 2D for circles with center
242      C and radii R.
243
244      *INPUT*
245     C
246           2-by-2 matrix containig coordinates of the centers of the
247           circles; one row per circle.
248
249     R
250           2-by-1 vector with the radii of the circles.
251
252      *OUPUT*
253     TANGENT
254           4-by-4 matrix with the points of tangency. Each row describes
255           a segment(edge).
256
257     INNER
258           4-by-2 vector with the point of intersection of the inner
259           tangents (crossed belts) with the segment that joins the
260           centers of the two circles. If the i-th edge is not an inner
261           tangent then `inner(i,:)=[NaN,NaN]'.
262
263      Example:
264
265           c         = [0 0;1 3];
266           r         = [1 0.5];
267           [T inner] = beltproblem(c,r)
268           => T =
269            -0.68516   0.72839   1.34258   2.63581
270             0.98516   0.17161   0.50742   2.91419
271             0.98675  -0.16225   1.49338   2.91888
272            -0.88675   0.46225   0.55663   3.23112
273
274           => inner =
275             0.66667   2.00000
276             0.66667   2.00000
277                 NaN       NaN
278                 NaN       NaN
279
280      See also: edges2d
281
282
283
284
285
286 # name: <cell-element>
287 # type: sq_string
288 # elements: 1
289 # length: 73
290 Finds the four lines tangent to two circles with given centers and
291 radii.
292
293
294
295 # name: <cell-element>
296 # type: sq_string
297 # elements: 1
298 # length: 8
299 bisector
300
301
302 # name: <cell-element>
303 # type: sq_string
304 # elements: 1
305 # length: 474
306  -- Function File: RAY =  bisector (LINE1, LINE2)
307  -- Function File: RAY =  bisector (P1, P2, P3)
308      Return the bisector of two lines, or 3 points.
309
310      Creates the bisector of the two lines, given as [x0 y0 dx dy].
311
312      create the bisector of lines (P2 P1) and (P2 P3).
313
314      The result has the form [x0 y0 dx dy], with [x0 y0] being the
315      origin   point ans [dx dy] being the direction vector, normalized
316      to have unit   norm.
317
318      See also: lines2d, rays2d
319
320
321
322
323
324 # name: <cell-element>
325 # type: sq_string
326 # elements: 1
327 # length: 46
328 Return the bisector of two lines, or 3 points.
329
330
331
332 # name: <cell-element>
333 # type: sq_string
334 # elements: 1
335 # length: 7
336 boxes2d
337
338
339 # name: <cell-element>
340 # type: sq_string
341 # elements: 1
342 # length: 401
343  -- Function File: boxes2d ()
344      Description of functions operating on bounding boxes.
345
346      A box is represented as a set of limits in each direction:
347           BOX = [XMIN XMAX YMIN YMAX].
348      Boxes are used as result of computation for bounding boxes, and to
349      clip shapes.
350
351      See also: clipPoints, clipLine, clipEdge, clipRay, mergeBoxes,
352      intersectBoxes, randomPointInBox, drawBox
353
354
355
356
357
358 # name: <cell-element>
359 # type: sq_string
360 # elements: 1
361 # length: 53
362 Description of functions operating on bounding boxes.
363
364
365
366 # name: <cell-element>
367 # type: sq_string
368 # elements: 1
369 # length: 13
370 cartesianLine
371
372
373 # name: <cell-element>
374 # type: sq_string
375 # elements: 1
376 # length: 234
377  -- Function File: LINE =  cartesianLine (A, B,C)
378      Create a straight line from cartesian equation coefficients.
379
380      Create a line verifying the Cartesian equation:   A*x + B*x + C =
381      0;
382
383      See also: lines2d, createLine
384
385
386
387
388
389 # name: <cell-element>
390 # type: sq_string
391 # elements: 1
392 # length: 60
393 Create a straight line from cartesian equation coefficients.
394
395
396
397 # name: <cell-element>
398 # type: sq_string
399 # elements: 1
400 # length: 12
401 cbezier2poly
402
403
404 # name: <cell-element>
405 # type: sq_string
406 # elements: 1
407 # length: 1289
408  -- Function File: PP = cbezier2poly (POINTS)
409  -- Command: Function File [X Y] = cbezier2poly (POINTS,T)
410      Returns the polynomial representation of the cubic Bezier defined
411      by the control points POINTS.
412
413      With only one input argument, calculates the polynomial PP of the
414      cubic Bezier curve defined by the 4 control points stored in
415      POINTS. The first point is the inital point of the curve. The
416      segment joining the first point with the second point (first
417      center) defines the tangent of the curve at the initial point.
418      The segment that joints the third point (second center) with the
419      fourth defines the tanget at the end-point of the curve, which is
420      defined in the fourth point.  POINTS is either a 4-by-2 array
421      (vertical concatenation of point coordinates), or a 1-by-8 array
422      (horizotnal concatenation of point coordinates). PP is a 2-by-3
423      array, 1st row is the polynomial for the x-coordinate and the 2nd
424      row for the y-coordinate. Each row can be evaluated with
425      `polyval'. The polynomial PP(t) is defined for t in [0,1].
426
427      When called with a second input argument T, it returns the
428      coordinates X and Y corresponding to the polynomial evaluated at T
429      in [0,1].
430
431      See also: drawBezierCurve, polyval
432
433
434
435
436
437 # name: <cell-element>
438 # type: sq_string
439 # elements: 1
440 # length: 80
441 Returns the polynomial representation of the cubic Bezier defined by
442 the control
443
444
445
446 # name: <cell-element>
447 # type: sq_string
448 # elements: 1
449 # length: 8
450 centroid
451
452
453 # name: <cell-element>
454 # type: sq_string
455 # elements: 1
456 # length: 889
457  -- Function File: C =  centroid (POINTS)
458  -- Function File: C =  centroid (PX, PY)
459  -- Function File: C =  centroid (..., MASS)
460      Compute centroid (center of mass) of a set of points.
461
462      Computes the ND-dimensional centroid of a set of points.    POINTS
463      is an array with as many rows as the number of points, and as
464      many columns as the number of dimensions.    PX and PY are two
465      column vectors containing coordinates of the   2-dimensional
466      points.    The result C is a row vector with ND columns.
467
468      If MASS is given, computes center of mass of POINTS, weighted by
469      coefficient MASS.    POINTS is a Np-by-Nd array, MASS is Np-by-1
470      array, and PX and PY are   also both Np-by-1 arrays.
471
472      Example:
473
474             pts = [2 2;6 1;6 5;2 4];
475             centroid(pts)
476             ans =
477                  4     3
478
479      See also: points2d, polygonCentroid
480
481
482
483
484
485 # name: <cell-element>
486 # type: sq_string
487 # elements: 1
488 # length: 53
489 Compute centroid (center of mass) of a set of points.
490
491
492
493 # name: <cell-element>
494 # type: sq_string
495 # elements: 1
496 # length: 16
497 circleArcAsCurve
498
499
500 # name: <cell-element>
501 # type: sq_string
502 # elements: 1
503 # length: 783
504  -- Function File: P =  circleArcAsCurve (ARC, N)
505      Convert a circle arc into a series of points
506
507      P = circleArcAsCurve(ARC, N);   convert the circle ARC into a
508      series of N points.    ARC is given in the format: [XC YC R THETA1
509      DTHETA]   where XC and YC define the center of the circle, R its
510      radius, THETA1   is the start of the arc and DTHETA is the angle
511      extent of the arc. Both   angles are given in degrees.    N is the
512      number of vertices of the resulting polyline, default is 65.
513
514      The result is a N-by-2 array containing coordinates of the N
515      points.
516
517      [X Y] = circleArcAsCurve(ARC, N);   Return the result in two
518      separate arrays with N lines and 1 column.
519
520      See also: circles2d, circleAsPolygon, drawCircle, drawPolygon
521
522
523
524
525
526 # name: <cell-element>
527 # type: sq_string
528 # elements: 1
529 # length: 45
530 Convert a circle arc into a series of points
531
532
533
534
535 # name: <cell-element>
536 # type: sq_string
537 # elements: 1
538 # length: 15
539 circleAsPolygon
540
541
542 # name: <cell-element>
543 # type: sq_string
544 # elements: 1
545 # length: 572
546  -- Function File: P =  circleAsPolygon (CIRCLE, N)
547      Convert a circle into a series of points
548
549      P = circleAsPolygon(CIRCLE, N);   convert circle given as [x0 y0
550      r], where x0 and y0 are coordinate of   center, and r is the
551      radius, into an array of  [(N+1)x2] double,   containing x and y
552      values of points.    The polygon is closed
553
554      P = circleAsPolygon(CIRCLE);   uses a default value of N=64 points
555
556      Example   circle = circleAsPolygon([10 0 5], 16);   figure;
557      drawPolygon(circle);
558
559      See also: circles2d, polygons2d, createCircle
560
561
562
563
564
565 # name: <cell-element>
566 # type: sq_string
567 # elements: 1
568 # length: 41
569 Convert a circle into a series of points
570
571
572
573
574 # name: <cell-element>
575 # type: sq_string
576 # elements: 1
577 # length: 9
578 circles2d
579
580
581 # name: <cell-element>
582 # type: sq_string
583 # elements: 1
584 # length: 925
585  -- Function File: circles2d ()
586      Description of functions operating on circles
587
588      Circles are represented by their center and their radius:   C =
589      [xc yc r];   One sometimes considers orientation of circle, by
590      adding an extra   boolean value in 4-th position, with value TRUE
591      for direct (i.e.    turning Counter-clockwise) circles.
592
593      Circle arcs are represented by their center, their radius, the
594      starting   angle and the angle extent, both in degrees:   CA = [xc
595      yc r theta0 dtheta];
596
597      Ellipses are represented by their center, their 2 semi-axis
598      length, and   their angle (in degrees) with Ox direction.    E =
599      [xc yc A B theta];
600
601      See also: ellipses2d, createCircle, createDirectedCircle,
602      enclosingCircle   isPointInCircle, isPointOnCircle
603      intersectLineCircle, intersectCircles, radicalAxis
604      circleAsPolygon, circleArcAsCurve   drawCircle, drawCircleArc
605
606
607
608
609
610 # name: <cell-element>
611 # type: sq_string
612 # elements: 1
613 # length: 46
614 Description of functions operating on circles
615
616
617
618
619 # name: <cell-element>
620 # type: sq_string
621 # elements: 1
622 # length: 8
623 clipEdge
624
625
626 # name: <cell-element>
627 # type: sq_string
628 # elements: 1
629 # length: 408
630  -- Function File: EDGE2 = clipEdge (EDGE, BOX)
631      Clip an edge with a rectangular box.
632
633      EDGE: [x1 y1 x2 y2],   BOX : [xmin xmax ; ymin ymax] or [xmin xmax
634      ymin ymax];   return :   EDGE2 = [xc1 yc1 xc2 yc2];
635
636      If clipping is null, return [0 0 0 0];
637
638      if EDGE is a [nx4] array, return an [nx4] array, corresponding to
639      each   clipped edge.
640
641      See also: edges2d, boxes2d, clipLine
642
643
644
645
646
647 # name: <cell-element>
648 # type: sq_string
649 # elements: 1
650 # length: 36
651 Clip an edge with a rectangular box.
652
653
654
655 # name: <cell-element>
656 # type: sq_string
657 # elements: 1
658 # length: 8
659 clipLine
660
661
662 # name: <cell-element>
663 # type: sq_string
664 # elements: 1
665 # length: 910
666  -- Function File: EDGE = clipLine (LINE, BOX)
667      Clip a line with a box.
668
669      LINE is a straight line given as a 4 element row vector: [x0 y0 dx
670      dy],   with (x0 y0) being a point of the line and (dx dy) a
671      direction vector,   BOX is the clipping box, given by its extreme
672      coordinates:   [xmin xmax ymin ymax].    The result is given as an
673      edge, defined by the coordinates of its 2   extreme points: [x1 y1
674      x2 y2].    If line does not intersect the box, [NaN NaN NaN NaN]
675      is returned.
676
677      Function works also if LINE is a Nx4 array, if BOX is a Nx4 array,
678      or   if both LINE and BOX are Nx4 arrays. In these cases, EDGE is
679      a Nx4   array.
680
681      Example:
682
683             line = [30 40 10 0];
684             box = [0 100 0 100];
685             res = clipLine(line, box)
686             res =
687                 0 40 100 40
688
689      See also: lines2d, boxes2d, edges2d, clipEdge, clipRay
690
691
692
693
694
695 # name: <cell-element>
696 # type: sq_string
697 # elements: 1
698 # length: 23
699 Clip a line with a box.
700
701
702
703 # name: <cell-element>
704 # type: sq_string
705 # elements: 1
706 # length: 10
707 clipPoints
708
709
710 # name: <cell-element>
711 # type: sq_string
712 # elements: 1
713 # length: 218
714  -- Function File: POINTS2 = clipPoints (POINTS, BOX)
715      Clip a set of points by a box.
716
717      Returns the set POINTS2 which are located inside of the box BOX.
718
719      See also: points2d, boxes2d, clipLine, drawPoint
720
721
722
723
724
725 # name: <cell-element>
726 # type: sq_string
727 # elements: 1
728 # length: 30
729 Clip a set of points by a box.
730
731
732
733 # name: <cell-element>
734 # type: sq_string
735 # elements: 1
736 # length: 7
737 clipRay
738
739
740 # name: <cell-element>
741 # type: sq_string
742 # elements: 1
743 # length: 752
744  -- Function File: [EDGE INSIDE] = clipRay (RAY, BOX)
745      Clip a ray with a box.
746
747      RAY is a straight ray given as a 4 element row vector: [x0 y0 dx
748      dy],   with (x0 y0) being the origin of the ray and (dx dy) its
749      direction   vector, BOX is the clipping box, given by its extreme
750      coordinates:   [xmin xmax ymin ymax].    The result is given as an
751      edge, defined by the coordinates of its 2   extreme points: [x1 y1
752      x2 y2].    If the ray does not intersect the box, [NaN NaN NaN
753      NaN] is returned.
754
755      Function works also if RAY is a Nx4 array, if BOX is a Nx4 array,
756      or   if both RAY and BOX are Nx4 arrays. In these cases, EDGE is a
757      Nx4   array.
758
759      See also: rays2d, boxes2d, edges2d, clipLine, drawRay
760
761
762
763
764
765 # name: <cell-element>
766 # type: sq_string
767 # elements: 1
768 # length: 22
769 Clip a ray with a box.
770
771
772
773 # name: <cell-element>
774 # type: sq_string
775 # elements: 1
776 # length: 11
777 closed_path
778
779
780 # name: <cell-element>
781 # type: sq_string
782 # elements: 1
783 # length: 173
784  -- Function File: Y = polygon (X)
785      Returns a simple closed path that passes through all the points in
786      X.  X is a vector containing 2D coordinates of the points.
787
788
789
790
791
792 # name: <cell-element>
793 # type: sq_string
794 # elements: 1
795 # length: 69
796 Returns a simple closed path that passes through all the points in X.
797
798
799
800 # name: <cell-element>
801 # type: sq_string
802 # elements: 1
803 # length: 11
804 cov2ellipse
805
806
807 # name: <cell-element>
808 # type: sq_string
809 # elements: 1
810 # length: 686
811  -- Function File: ELLIPSE =  cov2ellipse (K)
812  -- Function File: [RA RB THETA] =  cov2ellipse (K)
813  -- Function File: ... =  cov2ellipse (..., `tol',TOL)
814      Calculates ellipse parameters from covariance matrix.
815
816      K must be symmetric positive (semi)definite. The optional argument
817      `tol' sets the tolerance for the verification of the
818      positive-(semi)definiteness of the matrix K (see `isdefinite').
819
820      If only one output argument is supplied a vector defining a
821      ellipse is returned as defined in `ellipses2d'. Otherwise the
822      angle THETA is given in radians.
823
824      Run `demo cov2ellipse' to see an example.
825
826      See also: ellipses2d, cov2ellipse, drawEllipse
827
828
829
830
831
832 # name: <cell-element>
833 # type: sq_string
834 # elements: 1
835 # length: 53
836 Calculates ellipse parameters from covariance matrix.
837
838
839
840 # name: <cell-element>
841 # type: sq_string
842 # elements: 1
843 # length: 12
844 crackPattern
845
846
847 # name: <cell-element>
848 # type: sq_string
849 # elements: 1
850 # length: 909
851  -- Function File: E =  crackPattern (BOX, POINTS, ALPHA)
852      Create a (bounded) crack pattern tessellation
853
854      E = crackPattern2(BOX, POINTS, ALPHA)   create a crack propagation
855      pattern wit following parameters :   - pattern is bounded by area
856      BOX which is a polygon.    - each crack originates from points
857      given in POINTS   - directions of each crack is given by a [NxM]
858      array ALPHA, where M is   the number of rays emanating from each
859      seed/   - a crack stop when it reaches another already created
860      crack.    - all cracks stop when they reach the border of the
861      frame, given by box   (a serie of 4 points).    The result is a
862      collection of edges, in the form [x1 y1 x2 y2].
863
864      E = crackPattern2(BOX, POINTS, ALPHA, SPEED)   Also specify speed
865      of propagation of each crack.
866
867      See the result with :     figure;     drawEdge(E);
868
869      See also: drawEdge
870
871
872
873
874
875 # name: <cell-element>
876 # type: sq_string
877 # elements: 1
878 # length: 46
879 Create a (bounded) crack pattern tessellation
880
881
882
883
884 # name: <cell-element>
885 # type: sq_string
886 # elements: 1
887 # length: 13
888 crackPattern2
889
890
891 # name: <cell-element>
892 # type: sq_string
893 # elements: 1
894 # length: 910
895  -- Function File: E =  crackPattern2 (BOX, POINTS, ALPHA)
896      Create a (bounded) crack pattern tessellation
897
898      E = crackPattern2(BOX, POINTS, ALPHA)   create a crack propagation
899      pattern wit following parameters :   - pattern is bounded by area
900      BOX which is a polygon.    - each crack originates from points
901      given in POINTS   - directions of each crack is given by a [NxM]
902      array ALPHA, where M is   the number of rays emanating from each
903      seed/   - a crack stop when it reaches another already created
904      crack.    - all cracks stop when they reach the border of the
905      frame, given by box   (a serie of 4 points).    The result is a
906      collection of edges, in the form [x1 y1 x2 y2].
907
908      E = crackPattern2(BOX, POINTS, ALPHA, SPEED)   Also specify speed
909      of propagation of each crack.
910
911      See the result with :     figure;     drawEdge(E);
912
913      See also: drawEdge
914
915
916
917
918
919 # name: <cell-element>
920 # type: sq_string
921 # elements: 1
922 # length: 46
923 Create a (bounded) crack pattern tessellation
924
925
926
927
928 # name: <cell-element>
929 # type: sq_string
930 # elements: 1
931 # length: 20
932 createBasisTransform
933
934
935 # name: <cell-element>
936 # type: sq_string
937 # elements: 1
938 # length: 1405
939  -- Function File: T =  createBasisTransfrom (TARGET)
940  -- Function File: T =  createBasisTransfrom (SOURCE, TARGET)
941      Compute matrix for transforming a basis into another basis
942
943      With only one input arguemnt, assumes the SOURCE is the standard
944      (Oij) basis, with origin at (0,0),   first direction vector equal
945      to (1,0) and second direction  vector   equal to (0,1). Otherwise
946      SOURCE specifies the SOURCE basis.
947
948      Both SOURCE and TARGET represent basis, in the following form:
949      [x0 y0  ex1 ey1  ex2 ey2]   [y0 y0] is the origin of the basis,
950      [ex1 ey1] is the first direction   vector, and [ex2 ey2] is the
951      second direction vector.
952
953      The result T is a 3-by-3 matrix such that a point expressed with
954      coordinates of the first basis will be represented by new
955      coordinates   `P2 = transformPoint(P1, T)' in the TARGET basis.
956
957      Example
958               % standard basis transform
959               src = [0 0   1 0   0 1];
960               % TARGET transform, just a rotation by atan(2/3) followed by a scaling
961               tgt = [0 0   .75 .5   -.5 .75];
962               % compute transform
963               trans = createBasisTransform(src, tgt);
964               % transform the point (.25,1.25) into the point (1,1)
965               p1 = [.25 1.25];
966               p2 = transformPoint(p1, trans)
967               ans =
968                   1   1
969
970      See also: transforms2d
971
972
973
974
975
976 # name: <cell-element>
977 # type: sq_string
978 # elements: 1
979 # length: 59
980 Compute matrix for transforming a basis into another basis
981
982
983
984
985 # name: <cell-element>
986 # type: sq_string
987 # elements: 1
988 # length: 12
989 createCircle
990
991
992 # name: <cell-element>
993 # type: sq_string
994 # elements: 1
995 # length: 881
996  -- Function File: CIRCLE =  createCircle (P1, P2, P3)
997  -- Function File: CIRCLE =  createCircle (P1, P2)
998      Create a circle from 2 or 3 points.
999
1000      Creates the circle passing through the 3 given points.    C is a
1001      1x3 array of the form: [XC YX R].
1002
1003      When two points are given, creates the circle whith center P1 and
1004      passing throuh the point P2.
1005
1006      Works also when input are point arrays the same size, in this case
1007      the   result has as many lines as the point arrays.
1008
1009      Example
1010
1011             % Draw a circle passing through 3 points.
1012               p1 = [10 15];
1013               p2 = [15 20];
1014               p3 = [10 25];
1015               circle = createCircle(p1, p2, p3);
1016               figure; hold on; axis equal; axis([0 50 0 50]);
1017               drawPoint([p1 ; p2; p3]);
1018               drawCircle(circle);
1019
1020      See also: circles2d, createDirectedCircle
1021
1022
1023
1024
1025
1026 # name: <cell-element>
1027 # type: sq_string
1028 # elements: 1
1029 # length: 35
1030 Create a circle from 2 or 3 points.
1031
1032
1033
1034 # name: <cell-element>
1035 # type: sq_string
1036 # elements: 1
1037 # length: 20
1038 createDirectedCircle
1039
1040
1041 # name: <cell-element>
1042 # type: sq_string
1043 # elements: 1
1044 # length: 569
1045  -- Function File: CIRCLE =  createDirectedCircle (P1, P2, P3)
1046  -- Function File: CIRCLE =  createDirectedCircle (P1, P2)
1047      Create a circle from 2 or 3 points.
1048
1049      Creates the circle passing through the 3 given points.    C is a
1050      1x4 array of the form: [XC YX R INV].
1051
1052      When two points are given, creates the circle whith center P1 and
1053      passing throuh the point P2.
1054
1055      Works also when input are point arrays the same size, in this case
1056      the   result has as many lines as the point arrays.
1057
1058      Example
1059
1060      See also: circles2d, createCircle
1061
1062
1063
1064
1065
1066 # name: <cell-element>
1067 # type: sq_string
1068 # elements: 1
1069 # length: 35
1070 Create a circle from 2 or 3 points.
1071
1072
1073
1074 # name: <cell-element>
1075 # type: sq_string
1076 # elements: 1
1077 # length: 10
1078 createEdge
1079
1080
1081 # name: <cell-element>
1082 # type: sq_string
1083 # elements: 1
1084 # length: 1092
1085  -- Function File: EDGE =  createEdge (P1, P2)
1086  -- Function File: EDGE =  createEdge (X0, Y0, DX, DY)
1087  -- Function File: EDGE =  createEdge (PARAM)
1088  -- Function File: EDGE =  createEdge (LINE, D)
1089      Create an edge between two points, or from a line.
1090
1091      The internal format for edge representation is given by
1092      coordinates of   two points : [x1 y1 x2 y2].    This function can
1093      serve as a line to edge converter.
1094
1095      Returns the edge between the two given points P1 and P2.
1096
1097      Returns the edge going through point (X0, Y0) and with direction
1098      vector (DX,DY).
1099
1100      When PARAM is an array of 4 values, creates the edge going through
1101      the   point (param(1) param(2)), and with direction vector given by
1102       (param(3) param(4)).
1103
1104      When LINE is given, creates the edge contained in LINE, with same
1105      direction and start point, but with length given by D.
1106
1107      Note: in all cases, parameters can be vertical arrays of the same
1108      dimension. The result is then an array of edges, of dimensions
1109      [N*4].
1110
1111      See also: edges2d, lines2d, drawEdge, clipEdge
1112
1113
1114
1115
1116
1117 # name: <cell-element>
1118 # type: sq_string
1119 # elements: 1
1120 # length: 50
1121 Create an edge between two points, or from a line.
1122
1123
1124
1125 # name: <cell-element>
1126 # type: sq_string
1127 # elements: 1
1128 # length: 15
1129 createHomothecy
1130
1131
1132 # name: <cell-element>
1133 # type: sq_string
1134 # elements: 1
1135 # length: 245
1136  -- Function File: T =  createHomothecy (POINT, RATIO)
1137      Create the the 3x3 matrix of an homothetic transform.
1138
1139      POINT is the center of the homothecy, RATIO is its factor.
1140
1141      See also: transforms2d, transformPoint, createTranslation
1142
1143
1144
1145
1146
1147 # name: <cell-element>
1148 # type: sq_string
1149 # elements: 1
1150 # length: 53
1151 Create the the 3x3 matrix of an homothetic transform.
1152
1153
1154
1155 # name: <cell-element>
1156 # type: sq_string
1157 # elements: 1
1158 # length: 10
1159 createLine
1160
1161
1162 # name: <cell-element>
1163 # type: sq_string
1164 # elements: 1
1165 # length: 2358
1166  -- Function File: LINE = createLine(varargin)
1167      Create a straight line from 2 points, or from other inputs
1168
1169      Line is represented in a parametric form : [x0 y0 dx dy]   x = x0
1170      + t*dx   y = y0 + t*dy;
1171
1172      L = createLine(p1, p2);   Returns the line going through the two
1173      given points.
1174
1175      L = createLine(x0, y0, dx, dy);   Returns the line going through
1176      point (x0, y0) and with direction   vector(dx, dy).
1177
1178      L = createLine(LINE);   where LINE is an array of 4 values,
1179      creates the line going through the   point (LINE(1) LINE(2)), and
1180      with direction given by vector (LINE(3)   LINE(4)).
1181
1182      L = createLine(THETA);   Create a polar line originated at (0,0)
1183      and with angle THETA.
1184
1185      L = createLine(RHO, THETA);   Create a polar line with normal
1186      theta, and with min distance to origin   equal to rho. rho can be
1187      negative, in this case, the line is the same   as with
1188      CREATELINE(-rho, theta+pi), but the orientation is different.
1189
1190      Note: in all cases, parameters can be vertical arrays of the same
1191      dimension. The result is then an array of lines, of dimensions
1192      [N*4].
1193
1194      NOTE : A line can also be represented with a 1*5 array :   [x0 y0
1195      dx dy t].    whith 't' being one of the following :   - t=0 : line
1196      is a singleton (x0,y0)   - t=1 : line is an edge segment, between
1197      points (x0,y0) and (x0+dx,   y0+dy).    - t=Inf : line is a Ray,
1198      originated from (x0,y0) and going to infinity   in the
1199      direction(dx,dy).    - t=-Inf : line is a Ray, originated from
1200      (x0,y0) and going to infinity   in the direction(-dx,-dy).    -
1201      t=NaN : line is a real straight line, and contains all points
1202      verifying the above equation.    This seems us a convenient way to
1203      represent uniformly all kind of lines   (including edges, rays,
1204      and even point).
1205
1206      NOTE2 : Any line object can be represented using a 1x6 array :
1207      [x0 y0 dx dy t0 t1]   the first 4 parameters define the supporting
1208      line,   t0 represent the position of the first point on the line,
1209      and t1 the position of the last point.    * for edges : t0 = 0,
1210      and t1=1   * for straight lines : t0 = -inf, t1=inf   * for rays :
1211      t0=0, t1=inf (or t0=-inf,t1=0 for inverted ray).    I propose to
1212      call these objects 'lineArc'
1213
1214      See also: lines2d, createEdge, createRay
1215
1216
1217
1218
1219
1220 # name: <cell-element>
1221 # type: sq_string
1222 # elements: 1
1223 # length: 59
1224 Create a straight line from 2 points, or from other inputs
1225
1226
1227
1228
1229 # name: <cell-element>
1230 # type: sq_string
1231 # elements: 1
1232 # length: 20
1233 createLineReflection
1234
1235
1236 # name: <cell-element>
1237 # type: sq_string
1238 # elements: 1
1239 # length: 332
1240  -- Function File: T =  function_name (LINE)
1241      Create the the 3x3 matrix of a line reflection.
1242
1243      Where LINE is given as [x0 y0 dx dy], return the affine tansform
1244      corresponding to the desired line reflection.
1245
1246      See also: lines2d, transforms2d, transformPoint,
1247      createTranslation, createHomothecy, createScaling
1248
1249
1250
1251
1252
1253 # name: <cell-element>
1254 # type: sq_string
1255 # elements: 1
1256 # length: 47
1257 Create the the 3x3 matrix of a line reflection.
1258
1259
1260
1261 # name: <cell-element>
1262 # type: sq_string
1263 # elements: 1
1264 # length: 9
1265 createRay
1266
1267
1268 # name: <cell-element>
1269 # type: sq_string
1270 # elements: 1
1271 # length: 877
1272  -- Function File:  RAY =  createRay (POINT, ANGLE)
1273  -- Function File:  RAY =  createRay (X0,Y0, ANGLE)
1274  -- Function File:  RAY =  createRay (P1, P2)
1275      Create a ray (half-line), from various inputs.
1276
1277      A Ray is represented in a parametric form: [x0 y0 dx dy].    x =
1278      x0 + t*dx   y = y0 + t*dy;   for all t>0.
1279
1280      POINT is a Nx2 array giving the starting point of the ray, and
1281      ANGLE is the   orientation of the ray respect to the positive
1282      x-axis. The ray origin can be specified with 2 input arguments
1283      X0,Y0.
1284
1285      If two points P1, P2 are given, creates a ray starting from point
1286      P1 and going in the direction of point   P2.
1287
1288      Example
1289             origin  = [3 4];
1290             theta   = pi/6;
1291             ray = createRay(origin, theta);
1292             axis([0 10 0 10]);
1293             drawRay(ray);
1294
1295      See also: rays2d, createLine, points2d
1296
1297
1298
1299
1300
1301 # name: <cell-element>
1302 # type: sq_string
1303 # elements: 1
1304 # length: 46
1305 Create a ray (half-line), from various inputs.
1306
1307
1308
1309 # name: <cell-element>
1310 # type: sq_string
1311 # elements: 1
1312 # length: 14
1313 createRotation
1314
1315
1316 # name: <cell-element>
1317 # type: sq_string
1318 # elements: 1
1319 # length: 651
1320  -- Function File: T =  createRotation (THETA)
1321  -- Function File: T =  createRotation (POINT, THETA)
1322  -- Function File: T =  createRotation (X0, Y0, THETA)
1323      Create the 3*3 matrix of a rotation.
1324
1325      Returns the rotation corresponding to angle THETA (in radians)
1326      The returned matrix has the form :   [cos(theta) -sin(theta)  0]
1327      [sin(theta)  cos(theta)  0]   [0           0           1]
1328
1329      POINT or (X0,Y0), specifies origin of rotation. The result is
1330      similar as performing   translation(-X0,-Y0), rotation(THETA), and
1331      translation(X0,Y0).
1332
1333      See also: transforms2d, transformPoint, createTranslation,
1334      createScaling
1335
1336
1337
1338
1339
1340 # name: <cell-element>
1341 # type: sq_string
1342 # elements: 1
1343 # length: 36
1344 Create the 3*3 matrix of a rotation.
1345
1346
1347
1348 # name: <cell-element>
1349 # type: sq_string
1350 # elements: 1
1351 # length: 13
1352 createScaling
1353
1354
1355 # name: <cell-element>
1356 # type: sq_string
1357 # elements: 1
1358 # length: 473
1359  -- Function File: T =  createScaling (S)
1360  -- Function File: T =  createScaling (SX, SY)
1361      Create the 3x3 matrix of a scaling in 2 dimensions.
1362
1363      Assume scaling S is equal n all directions unless SX and SY are
1364      given.    Returns the matrix corresponding to scaling in the 2
1365      main directions.    The returned matrix has the form:   [SX  0  0]
1366       [0  SY  0]   [0   0  1]
1367
1368      See also: transforms2d, transformPoint, createTranslation,
1369      createRotation
1370
1371
1372
1373
1374
1375 # name: <cell-element>
1376 # type: sq_string
1377 # elements: 1
1378 # length: 51
1379 Create the 3x3 matrix of a scaling in 2 dimensions.
1380
1381
1382
1383 # name: <cell-element>
1384 # type: sq_string
1385 # elements: 1
1386 # length: 17
1387 createTranslation
1388
1389
1390 # name: <cell-element>
1391 # type: sq_string
1392 # elements: 1
1393 # length: 438
1394  -- Function File: T =  createTranslation (VECTOR)
1395  -- Function File: T =  createTranslation (DX,DY)
1396      Create the 3*3 matrix of a translation.
1397
1398      Returns the matrix corresponding to a translation by the vector
1399      [DX DY].    The components can be given as two arguments.    The
1400      returned matrix has the form :   [1 0 TX]   [0 1 TY]   [0 0  1]
1401
1402      See also: transforms2d, transformPoint, createRotation,
1403      createScaling
1404
1405
1406
1407
1408
1409 # name: <cell-element>
1410 # type: sq_string
1411 # elements: 1
1412 # length: 39
1413 Create the 3*3 matrix of a translation.
1414
1415
1416
1417 # name: <cell-element>
1418 # type: sq_string
1419 # elements: 1
1420 # length: 12
1421 createVector
1422
1423
1424 # name: <cell-element>
1425 # type: sq_string
1426 # elements: 1
1427 # length: 560
1428  -- Function File: VECT =  createVector (P1, P2)
1429      Create a vector from two points.
1430
1431      V12 = createVector(P1, P2)   Creates the vector V12, defined as
1432      the difference between coordinates   of points P1 and P2.    P1
1433      and P2 are row vectors with ND elements, ND being the space
1434      dimension.
1435
1436      If one of the inputs is a N-by-Nd array, the other input is
1437      automatically repeated, and the result is N-by-Nd.
1438
1439      If both inputs have the same size, the result also have the same
1440      size.
1441
1442      See also: vectors2d, vectors3d, points2d
1443
1444
1445
1446
1447
1448 # name: <cell-element>
1449 # type: sq_string
1450 # elements: 1
1451 # length: 32
1452 Create a vector from two points.
1453
1454
1455
1456 # name: <cell-element>
1457 # type: sq_string
1458 # elements: 1
1459 # length: 7
1460 deg2rad
1461
1462
1463 # name: <cell-element>
1464 # type: sq_string
1465 # elements: 1
1466 # length: 325
1467  -- Function File: RAD = deg2rad(DEG)
1468      Convert angle from degrees to radians
1469
1470      Usage:   R = deg2rad(D)   convert an angle in degrees to an angle
1471      in radians.
1472
1473      Example   deg2rad(180)    % gives pi   ans =       3.1416
1474      deg2rad(60)     % gives pi/3   ans =       1.0472
1475
1476      See also: angles2d, rad2deg
1477
1478
1479
1480
1481
1482 # name: <cell-element>
1483 # type: sq_string
1484 # elements: 1
1485 # length: 38
1486 Convert angle from degrees to radians
1487
1488
1489
1490
1491 # name: <cell-element>
1492 # type: sq_string
1493 # elements: 1
1494 # length: 17
1495 distancePointEdge
1496
1497
1498 # name: <cell-element>
1499 # type: sq_string
1500 # elements: 1
1501 # length: 1248
1502  -- Function File: DIST =  distancePointEdge (POINT, EDGE)
1503  -- Function File: DIST =  distancePointEdge (..., OPT)
1504  -- Function File: [DIST POS]=  distancePointEdge (...)
1505      Minimum distance between a point and an edge
1506
1507      Return the euclidean distance between edge EDGE and point POINT.
1508      EDGE has the form: [x1 y1 x2 y2], and POINT is [x y].  If EDGE is
1509      Ne-by-4 and POINT is Np-by-2, then DIST is Np-by-Ne, where each
1510      row contains the distance of each point to all the edges.
1511
1512      If OPT is true (or equivalent), the optput is cmpatible with the
1513      original function:
1514     `1'
1515           If POINT is 1-by-2 array, the result is Ne-by-1 array
1516           computed for each edge.
1517
1518     `2'
1519           If EDGE is a 1-by-4 array, the result is Np-by-1 computed for
1520           each point.
1521
1522     `3'
1523           If both POINT and EDGE are array, they must have the same
1524           number of rows, and the result is computed for each couple
1525           `POINT(i,:),EDGE(i,:)'.
1526
1527      If the the second output argument POS is requested, the function
1528      also returns the position of closest point on the edge. POS is
1529      comprised between 0 (first point) and 1 (last point).
1530
1531      See also: edges2d, points2d, distancePoints, distancePointLine
1532
1533
1534
1535
1536
1537 # name: <cell-element>
1538 # type: sq_string
1539 # elements: 1
1540 # length: 45
1541 Minimum distance between a point and an edge
1542
1543
1544
1545
1546 # name: <cell-element>
1547 # type: sq_string
1548 # elements: 1
1549 # length: 17
1550 distancePointLine
1551
1552
1553 # name: <cell-element>
1554 # type: sq_string
1555 # elements: 1
1556 # length: 615
1557  -- Function File: DIST =  distancePointLine (POINT, LINE)
1558      Minimum distance between a point and a line
1559
1560      D = distancePointLine(POINT, LINE)   Return the euclidean distance
1561      between line LINE and point POINT.
1562
1563      LINE has the form : [x0 y0 dx dy], and POINT is [x y].
1564
1565      If LINE is N-by-4 array, result is N-by-1 array computes for each
1566      line.
1567
1568      If POINT is N-by-2, then result is computed for each point.
1569
1570      If both POINT and LINE are array, result is N-by-1, computed for
1571      each   corresponding point and line.
1572
1573      See also: lines2d, points2d, distancePoints, distancePointEdge
1574
1575
1576
1577
1578
1579 # name: <cell-element>
1580 # type: sq_string
1581 # elements: 1
1582 # length: 44
1583 Minimum distance between a point and a line
1584
1585
1586
1587
1588 # name: <cell-element>
1589 # type: sq_string
1590 # elements: 1
1591 # length: 14
1592 distancePoints
1593
1594
1595 # name: <cell-element>
1596 # type: sq_string
1597 # elements: 1
1598 # length: 826
1599  -- Function File: D =  distancePoints (P1, P2)
1600  -- Function File: D =  distancePoints (P1, P2, NORM)
1601  -- Function File: D =  distancePoints (..., 'diag')
1602      Compute distance between two points.
1603
1604      Returns the Euclidean distance between points P1 and P2.    If P1
1605      and P2 are two arrays of points, result is a N1xN2 array
1606      containing distance between each point of P1 and each point of P2.
1607
1608      Is NORM is given, computes distance using the specified norm.
1609      NORM=2 corresponds to usual   euclidean distance, NORM=1
1610      corresponds to Manhattan distance, NORM=inf   is assumed to
1611      correspond to maximum difference in coordinate. Other   values
1612      (>0) can be specified.
1613
1614      When 'diag' is given, computes only distances between P1(i,:) and
1615      P2(i,:).
1616
1617      See also: points2d, minDistancePoints
1618
1619
1620
1621
1622
1623 # name: <cell-element>
1624 # type: sq_string
1625 # elements: 1
1626 # length: 36
1627 Compute distance between two points.
1628
1629
1630
1631 # name: <cell-element>
1632 # type: sq_string
1633 # elements: 1
1634 # length: 9
1635 drawArrow
1636
1637
1638 # name: <cell-element>
1639 # type: sq_string
1640 # elements: 1
1641 # length: 686
1642  -- Function File: H =  drawArrow (X1, Y1, X2, Y2)
1643  -- Function File: H =  drawArrow ([ X1  Y1 X2 Y2])
1644  -- Function File: H =  drawArrow (..., L, W)
1645  -- Function File: H =  drawArrow (..., L, W,TYPE)
1646      Draw an arrow on the current axis.
1647
1648      draw an arrow between the points (X1 Y1) and (X2 Y2).  The points
1649      can be given as a single array. L, W specify length and width of
1650      the arrow.
1651
1652      Also specify arrow type. TYPE can be one of the following :   0:
1653      draw only two strokes   1: fill a triangle   .5: draw a half arrow
1654      (try it to see ...)
1655
1656      Arguments can be single values or array of size [N*1]. In this
1657      case,   the function draws multiple arrows.
1658
1659
1660
1661
1662
1663 # name: <cell-element>
1664 # type: sq_string
1665 # elements: 1
1666 # length: 34
1667 Draw an arrow on the current axis.
1668
1669
1670
1671 # name: <cell-element>
1672 # type: sq_string
1673 # elements: 1
1674 # length: 15
1675 drawBezierCurve
1676
1677
1678 # name: <cell-element>
1679 # type: sq_string
1680 # elements: 1
1681 # length: 1064
1682  -- Function File: drawBezierCurve (POINTS)
1683  -- Command: Function File drawBezierCurve (PP)
1684  -- Command: Function File drawBezierCurve (..., PARAM, VALUE, ...)
1685  -- Command: Function File H =drawBezierCurve (...)
1686      Draw a cubic bezier curve defined by the control points POINTS.
1687
1688      With only one input argument, draws the Bezier curve defined by
1689      the 4 control points stored in POINTS. POINTS is either a 4-by-2
1690      array (vertical concatenation of point coordinates), or a 1-by-8
1691      array (horizotnal concatenation of point coordinates). The curve
1692      could be described by its polynomial (output of `cbezier2poly')
1693      PP, which should be a 2-by-4 array.
1694
1695      The optional PARAM, VALUE pairs specify additional drawing
1696      parameters, see the `plot' function for details. The specific
1697      parameter 'discretization' with an integer associated value
1698      defines the amount of points used to plot the curve. If the output
1699      is requiered, the function returns the handle to the created
1700      graphic object.
1701
1702      See also: cbezier2poly, plot
1703
1704
1705
1706
1707
1708 # name: <cell-element>
1709 # type: sq_string
1710 # elements: 1
1711 # length: 63
1712 Draw a cubic bezier curve defined by the control points POINTS.
1713
1714
1715
1716 # name: <cell-element>
1717 # type: sq_string
1718 # elements: 1
1719 # length: 7
1720 drawBox
1721
1722
1723 # name: <cell-element>
1724 # type: sq_string
1725 # elements: 1
1726 # length: 388
1727  -- Function File: H = drawBox (BOX)
1728  -- Function File: H = drawBox (BOX, PARAM, VALUE, ...)
1729      Draw a box defined by coordinate extents
1730
1731      Draws a box defined by its extent: BOX = [XMIN XMAX YMIN YMAX].
1732      Addtional arguments are passed to function `plot'. If requested,
1733      it returns the handle to the graphics object created.
1734
1735      See also: drawOrientedBox, drawRect, plot
1736
1737
1738
1739
1740
1741 # name: <cell-element>
1742 # type: sq_string
1743 # elements: 1
1744 # length: 41
1745 Draw a box defined by coordinate extents
1746
1747
1748
1749
1750 # name: <cell-element>
1751 # type: sq_string
1752 # elements: 1
1753 # length: 16
1754 drawCenteredEdge
1755
1756
1757 # name: <cell-element>
1758 # type: sq_string
1759 # elements: 1
1760 # length: 1333
1761  -- Function File: H = drawCenteredEdge (CENTER, L, THETA)
1762  -- Function File: H = drawCenteredEdge (EDGE)
1763  -- Function File: H = drawCenteredEdge (..., NAME,VALUE)
1764      Draw an edge centered on a point.
1765
1766      drawCenteredEdge(CENTER, L, THETA)   Draws an edge centered on
1767      point CENTER, with length L, and orientation   THETA (given in
1768      degrees). Input arguments can also be arrays, that must   all have
1769      the same number odf rows.
1770
1771      drawCenteredEdge(EDGE)   Concatenates edge parameters into a
1772      single N-by-4 array, containing:   [XC YV L THETA].
1773
1774      drawCenteredEdge(..., NAME, VALUE)   Also specifies drawing
1775      options by using one or several parameter name -   value pairs
1776      (see doc of plot function for details).
1777
1778      H = drawCenteredEdge(...)    Returns handle(s) to the created
1779      edges(s).
1780
1781               % Draw an ellipse with its two axes
1782               figure(1); clf;
1783               center = [50 40];
1784               r1 = 30; r2 = 10;
1785               theta = 20;
1786               elli = [center r1 r2 theta];
1787               drawEllipse(elli, 'linewidth', 2);
1788               axis([0 100 0 100]); axis equal;
1789               hold on;
1790               edges = [center 2*r1 theta ; center 2*r2 theta+90];
1791               drawCenteredEdge(edges, 'linewidth', 2, 'color', 'g');
1792
1793      See also: edges2d, drawEdge
1794
1795
1796
1797
1798
1799 # name: <cell-element>
1800 # type: sq_string
1801 # elements: 1
1802 # length: 33
1803 Draw an edge centered on a point.
1804
1805
1806
1807 # name: <cell-element>
1808 # type: sq_string
1809 # elements: 1
1810 # length: 10
1811 drawCircle
1812
1813
1814 # name: <cell-element>
1815 # type: sq_string
1816 # elements: 1
1817 # length: 1142
1818  -- Function File: H =  drawCircle (X0, Y0, R)
1819  -- Function File: H =  drawCircle (CIRCLE)
1820  -- Function File: H =  drawCircle (CENTER, RADIUS)
1821  -- Function File: H =  drawCircle (..., NSTEP)
1822  -- Function File: H =  drawCircle (..., NAME, VALUE)
1823      Draw a circle on the current axis
1824
1825      drawCircle(X0, Y0, R);   Draw the circle with center (X0,Y0) and
1826      the radius R. If X0, Y0 and R   are column vectors of the same
1827      length, draw each circle successively.
1828
1829      drawCircle(CIRCLE);   Concatenate all parameters in a Nx3 array,
1830      where N is the number of   circles to draw.
1831
1832      drawCircle(CENTER, RADIUS);   Specify CENTER as Nx2 array, and
1833      radius as a Nx1 array.
1834
1835      drawCircle(..., NSTEP);   Specify the number of edges that will be
1836      used to draw the circle.    Default value is 72, creating an
1837      approximation of one point for each 5   degrees.
1838
1839      drawCircle(..., NAME, VALUE);   Specifies plotting options as pair
1840      of parameters name/value. See plot   documentation for details.
1841
1842      H = drawCircle(...);   return handles to each created curve.
1843
1844      See also: circles2d, drawCircleArc, drawEllipse
1845
1846
1847
1848
1849
1850 # name: <cell-element>
1851 # type: sq_string
1852 # elements: 1
1853 # length: 34
1854 Draw a circle on the current axis
1855
1856
1857
1858
1859 # name: <cell-element>
1860 # type: sq_string
1861 # elements: 1
1862 # length: 13
1863 drawCircleArc
1864
1865
1866 # name: <cell-element>
1867 # type: sq_string
1868 # elements: 1
1869 # length: 1004
1870  -- Function File: H =  drawCircleArc (XC, YC, R, START, END)
1871  -- Function File: H =  drawCircleArc (ARC)
1872  -- Function File: H =  drawCircleArc (..., PARAM, VALUE)
1873      Draw a circle arc on the current axis
1874
1875      drawCircleArc(XC, YC, R, START, EXTENT);   Draws circle with
1876      center (XC, YC), with radius R, starting from angle   START, and
1877      with angular extent given by EXTENT. START and EXTENT angles   are
1878      given in degrees.
1879
1880      drawCircleArc(ARC);   Puts all parameters into one single array.
1881
1882      drawCircleArc(..., PARAM, VALUE);   specifies plot properties by
1883      using one or several parameter name-value   pairs.
1884
1885      H = drawCircleArc(...);   Returns a handle to the created line
1886      object.
1887
1888               % Draw a red thick circle arc
1889               arc = [10 20 30 -120 240];
1890               figure;
1891               axis([-50 100 -50 100]);
1892               hold on
1893               drawCircleArc(arc, 'LineWidth', 3, 'Color', 'r')
1894
1895      See also: circles2d, drawCircle, drawEllipse
1896
1897
1898
1899
1900
1901 # name: <cell-element>
1902 # type: sq_string
1903 # elements: 1
1904 # length: 38
1905 Draw a circle arc on the current axis
1906
1907
1908
1909
1910 # name: <cell-element>
1911 # type: sq_string
1912 # elements: 1
1913 # length: 8
1914 drawEdge
1915
1916
1917 # name: <cell-element>
1918 # type: sq_string
1919 # elements: 1
1920 # length: 902
1921  -- Function File: H =  drawEdge (X1, Y1, X2, Y2)
1922  -- Function File: H =  drawEdge ([X1 Y1 X2 Y2])
1923  -- Function File: H =  drawEdge ([X1 Y1], [X2 Y2])
1924  -- Function File: H =  drawEdge (X1, Y1, Z1, X2, Y2, Z2)
1925  -- Function File: H =  drawEdge ([X1 Y1 Z1 X2 Y2 Z2])
1926  -- Function File: H =  drawEdge ([X1 Y1 Z1], [X2 Y2 Z2])
1927  -- Function File: H =  drawEdge (..., OPT)
1928      Draw an edge given by 2 points.
1929
1930      Draw an edge between the points (x1 y1) and  (x2 y2). Data can be
1931      bundled as an edge.    The function supports 3D edges.
1932      Arguments can be single values or array of size [Nx1]. In this
1933      case,   the function draws multiple edges.    OPT, being a set of
1934      pairwise options, can   specify color, line width and so on. These
1935      are passed to function `line'.    The function returns handle(s)
1936      to created edges(s).
1937
1938      See also: edges2d, drawCenteredEdge, drawLine, line
1939
1940
1941
1942
1943
1944 # name: <cell-element>
1945 # type: sq_string
1946 # elements: 1
1947 # length: 31
1948 Draw an edge given by 2 points.
1949
1950
1951
1952 # name: <cell-element>
1953 # type: sq_string
1954 # elements: 1
1955 # length: 11
1956 drawEllipse
1957
1958
1959 # name: <cell-element>
1960 # type: sq_string
1961 # elements: 1
1962 # length: 1330
1963  -- Function File: H =  drawEllipse (ELLI)
1964  -- Function File: H =  drawEllipse (XC, YC, RA, RB)
1965  -- Function File: H =  drawEllipse (XC, YC, RA, RB, THETA)
1966  -- Function File: H =  drawEllipse (..., PARAM, VALUE)
1967      Draw an ellipse on the current axis.
1968
1969      drawEllipse(ELLI);   Draws the ellipse ELLI in the form [XC YC RA
1970      RB THETA], with center   (XC, YC), with main axis of half-length
1971      RA and RB, and orientation   THETA in degrees counted
1972      counter-clockwise.    Puts all parameters into one single array.
1973
1974      drawEllipse(XC, YC, RA, RB);   drawEllipse(XC, YC, RA, RB, THETA);
1975       Specifies ellipse parameters as separate arguments (old syntax).
1976
1977      drawEllipse(..., NAME, VALUE);   Specifies drawing style of
1978      ellipse, see the help of plot function.
1979
1980      H = drawEllipse(...);   Also returns handles to the created line
1981      objects.
1982
1983      -> Parameters can also be arrays. In this case, all arrays are
1984      supposed   to have the same size.
1985
1986      Example:
1987             % Draw an ellipse centered in [50 50], with semi major axis length of
1988             % 40, semi minor axis length of 20, and rotated by 30 degrees.
1989               figure(1); clf; hold on;
1990               drawEllipse([50 50 40 20 30]);
1991               axis equal;
1992
1993      See also: ellipses2d, drawCircle, drawEllipseArc, ellipseAsPolygon
1994
1995
1996
1997
1998
1999 # name: <cell-element>
2000 # type: sq_string
2001 # elements: 1
2002 # length: 36
2003 Draw an ellipse on the current axis.
2004
2005
2006
2007 # name: <cell-element>
2008 # type: sq_string
2009 # elements: 1
2010 # length: 14
2011 drawEllipseArc
2012
2013
2014 # name: <cell-element>
2015 # type: sq_string
2016 # elements: 1
2017 # length: 1338
2018  -- Function File: H =  drawEllipseArc (ARC)
2019      Draw an ellipse arc on the current axis.
2020
2021      drawEllipseArc(ARC)   draw ellipse arc specified by ARC. ARC has
2022      the format:     ARC = [XC YC A B THETA T1 T2]   or:     ARC = [XC
2023      YC A B T1 T2] (isothetic ellipse)   with center (XC, YC), main
2024      axis of half-length A, second axis of   half-length B, and ellipse
2025      arc running from t1 to t2 (both in degrees,   in Counter-Clockwise
2026      orientation).
2027
2028      Parameters can also be arrays. In this case, all arrays are
2029      suposed to   have the same size...
2030
2031               % draw an ellipse arc: center = [10 20], radii = 50 and 30, theta = 45
2032               arc = [10 20 50 30 45 -90 270];
2033               figure;
2034               axis([-50 100 -50 100]); axis equal;
2035               hold on
2036               drawEllipseArc(arc, 'color', 'r')
2037
2038               % draw another ellipse arc, between angles -60 and 70
2039               arc = [10 20 50 30 45 -60 (60+70)];
2040               figure;
2041               axis([-50 100 -50 100]); axis equal;
2042               hold on
2043               drawEllipseArc(arc, 'LineWidth', 2);
2044               ray1 = createRay([10 20], deg2rad(-60+45));
2045               drawRay(ray1)
2046               ray2 = createRay([10 20], deg2rad(70+45));
2047               drawRay(ray2)
2048
2049      See also: ellipses2d, drawEllipse, drawCircleArc
2050
2051
2052
2053
2054
2055 # name: <cell-element>
2056 # type: sq_string
2057 # elements: 1
2058 # length: 40
2059 Draw an ellipse arc on the current axis.
2060
2061
2062
2063 # name: <cell-element>
2064 # type: sq_string
2065 # elements: 1
2066 # length: 10
2067 drawLabels
2068
2069
2070 # name: <cell-element>
2071 # type: sq_string
2072 # elements: 1
2073 # length: 673
2074  -- Function File: drawLabels (X, Y, LBL)
2075  -- Function File: drawLabels (POS, LBL)
2076  -- Function File: drawLabels (..., NUMBERS, FORMAT)
2077      Draw labels at specified positions.
2078
2079      DRAWLABELS(X, Y, LBL) draw labels LBL at position X and Y.    LBL
2080      can be either a string array, or a number array. In this case,
2081      string are created by using sprintf function, with '%.2f' mask.
2082
2083      DRAWLABELS(POS, LBL) draw labels LBL at position specified by POS,
2084       where POS is a N*2 int array.
2085
2086      DRAWLABELS(..., NUMBERS, FORMAT) create labels using sprintf
2087      function,   with the mask given by FORMAT (e. g. '%03d' or
2088      '5.3f'), and the   corresponding values.
2089
2090
2091
2092
2093 # name: <cell-element>
2094 # type: sq_string
2095 # elements: 1
2096 # length: 35
2097 Draw labels at specified positions.
2098
2099
2100
2101 # name: <cell-element>
2102 # type: sq_string
2103 # elements: 1
2104 # length: 8
2105 drawLine
2106
2107
2108 # name: <cell-element>
2109 # type: sq_string
2110 # elements: 1
2111 # length: 662
2112  -- Function File: H = drawLine (LINE)
2113  -- Function File: H = drawLine (LINE, PARAM,VALUE)
2114      Draw the line on the current axis.
2115
2116      Draws the line LINE on the current axis, by using current axis to
2117      clip   the line. Extra PARAM,VALUE pairs are passed to the `line'
2118      function.    Returns a handle to the created line object. If
2119      clipped line is not   contained in the axis, the function returns
2120      -1.
2121
2122      Example
2123
2124             figure; hold on; axis equal;
2125             axis([0 100 0 100]);
2126             drawLine([30 40 10 20]);
2127             drawLine([30 40 20 -10], 'color', 'm', 'linewidth', 2);
2128
2129      See also: lines2d, createLine, drawEdge
2130
2131
2132
2133
2134
2135 # name: <cell-element>
2136 # type: sq_string
2137 # elements: 1
2138 # length: 34
2139 Draw the line on the current axis.
2140
2141
2142
2143 # name: <cell-element>
2144 # type: sq_string
2145 # elements: 1
2146 # length: 15
2147 drawOrientedBox
2148
2149
2150 # name: <cell-element>
2151 # type: sq_string
2152 # elements: 1
2153 # length: 819
2154  -- Function File: HB =  drawOrientedBox (BOX)
2155  -- Function File: HB =  drawOrientedBox (..., PARAM, VALUE)
2156      Draw centered oriented rectangle.
2157
2158      Syntax   drawOrientedBox(BOX)   drawOrientedBox(BOX,
2159      'PropertyName', propertyvalue, ...)
2160
2161      Description   drawOrientedBox(OBOX)   Draws an oriented rectangle
2162      (or bounding box) on the current axis.    OBOX is a 1-by-5 row
2163      vector containing box center, dimension (length   and width) and
2164      orientation (in degrees):   OBOX = [CX CY LENGTH WIDTH THETA].
2165
2166      When OBOX is a N-by-5 array, the N boxes are drawn.
2167
2168      HB = drawOrientedBox(...)    Returns a handle to the created
2169      graphic object(s). Object style can be   modified using syntaw
2170      like:   set(HB, 'color', 'g', 'linewidth', 2);
2171
2172      See also: drawPolygon, drawRect, drawBox
2173
2174
2175
2176
2177
2178 # name: <cell-element>
2179 # type: sq_string
2180 # elements: 1
2181 # length: 33
2182 Draw centered oriented rectangle.
2183
2184
2185
2186 # name: <cell-element>
2187 # type: sq_string
2188 # elements: 1
2189 # length: 12
2190 drawParabola
2191
2192
2193 # name: <cell-element>
2194 # type: sq_string
2195 # elements: 1
2196 # length: 1510
2197  -- Function File: H =  drawParabola (PARABOLA)
2198  -- Function File: H =  drawParabola (PARABOLA, T)
2199  -- Function File: H =  drawParabola (..., PARAM, VALUE)
2200      Draw a parabola on the current axis.
2201
2202      drawParabola(PARABOLA);   Draws a vertical parabola, defined by
2203      its vertex and its parameter.    Such a parabola admits a vertical
2204      axis of symetry.
2205
2206      The algebraic equation of parabola is given by:      (Y - YV) = A
2207      * (X - VX)^2   Where XV and YV are vertex coordinates and A is
2208      parabola parameter.
2209
2210      A parametric equation of parabola is given by:      x(t) = t + VX;
2211          y(t) = A * t^2 + VY;
2212
2213      PARABOLA can also be defined by [XV YV A THETA], with theta being
2214      the   angle of rotation of the parabola (in degrees and
2215      Counter-Clockwise).
2216
2217      drawParabola(PARABOLA, T);   Specifies which range of 't' are used
2218      for drawing parabola. If T is an   array with only two values, the
2219      first and the last values are used as   interval bounds, and
2220      several values are distributed within this   interval.
2221
2222      drawParabola(..., NAME, VALUE);   Can specify one or several
2223      graphical options using parameter name-value   pairs.
2224
2225      H = drawParabola(...);   Returns an handle to the created
2226      graphical object.
2227
2228      Example:
2229             figure(1); clf; hold on;
2230             drawParabola([50 50 .2 30]);
2231             drawParabola([50 50 .2 30], [-1 1], 'color', 'r', 'linewidth', 2);
2232             axis equal;
2233
2234      See also: drawCircle, drawEllipse
2235
2236
2237
2238
2239
2240 # name: <cell-element>
2241 # type: sq_string
2242 # elements: 1
2243 # length: 36
2244 Draw a parabola on the current axis.
2245
2246
2247
2248 # name: <cell-element>
2249 # type: sq_string
2250 # elements: 1
2251 # length: 9
2252 drawPoint
2253
2254
2255 # name: <cell-element>
2256 # type: sq_string
2257 # elements: 1
2258 # length: 429
2259  -- Function File: H =  drawPoint (X, Y)
2260  -- Function File: H =  drawPoint (COORD)
2261  -- Function File: H =  drawPoint (..., OPT)
2262      Draw the point on the axis.
2263
2264      Draws points defined by coordinates X and YY.    X and Y should be
2265      array the same size. Coordinates can be   packed coordinates in a
2266      single [N*2] array COORD. Options OPT   are passed to the `plot'
2267      function.
2268
2269      See also: points2d, clipPoints
2270
2271
2272
2273
2274
2275 # name: <cell-element>
2276 # type: sq_string
2277 # elements: 1
2278 # length: 27
2279 Draw the point on the axis.
2280
2281
2282
2283 # name: <cell-element>
2284 # type: sq_string
2285 # elements: 1
2286 # length: 7
2287 drawRay
2288
2289
2290 # name: <cell-element>
2291 # type: sq_string
2292 # elements: 1
2293 # length: 396
2294  -- Function File: H =  drawRay (RAY)
2295  -- Function File: H =  drawRay (RAY, PARAM, VALUE)
2296      Draw a ray on the current axis.
2297
2298      With RAY having the syntax: [x0 y0 dx dy], draws the ray starting
2299      from  point (x0 y0) and going to direction (dx dy), clipped with
2300      the current  window axis. PARAM, VALUE pairs are passed to
2301      function `line'.
2302
2303      See also: rays2d, drawLine, line
2304
2305
2306
2307
2308
2309 # name: <cell-element>
2310 # type: sq_string
2311 # elements: 1
2312 # length: 31
2313 Draw a ray on the current axis.
2314
2315
2316
2317 # name: <cell-element>
2318 # type: sq_string
2319 # elements: 1
2320 # length: 8
2321 drawRect
2322
2323
2324 # name: <cell-element>
2325 # type: sq_string
2326 # elements: 1
2327 # length: 673
2328  -- Function File: R =  drawRect (X, Y, W, H)
2329  -- Function File: R =  drawRect (X, Y, W, H, THETA)
2330  -- Function File: R =  drawRect (COORD)
2331      Draw rectangle on the current axis.
2332
2333      r = DRAWRECT(x, y, w, h) draw rectangle with width W and height H,
2334      at   position (X, Y).    the four corners of rectangle are then :
2335      (X, Y), (X+W, Y), (X, Y+H), (X+W, Y+H).
2336
2337      r = DRAWRECT(x, y, w, h, theta) also specifies orientation for
2338      rectangle. Theta is given in degrees.
2339
2340      r = DRAWRECT(coord) is the same as DRAWRECT(X,Y,W,H), but all
2341      parameters are packed into one array, whose dimensions is 4*1 or
2342      5*1.
2343
2344      See also: drawBox, drawOrientedBox
2345
2346
2347
2348
2349
2350 # name: <cell-element>
2351 # type: sq_string
2352 # elements: 1
2353 # length: 35
2354 Draw rectangle on the current axis.
2355
2356
2357
2358 # name: <cell-element>
2359 # type: sq_string
2360 # elements: 1
2361 # length: 9
2362 drawShape
2363
2364
2365 # name: <cell-element>
2366 # type: sq_string
2367 # elements: 1
2368 # length: 823
2369  -- Function File: drawShape (TYPE, PARAM)
2370  -- Function File: drawShape (..., OPTION)
2371      Draw various types of shapes (circles, polygons...).
2372
2373      drawShape(TYPE, PARAM)   Draw the shape of type TYPE, specified by
2374      given parameter PARAM. TYPE   can be one of 'circle', 'ellipse',
2375      'rect', 'polygon', 'curve'   PARAM depend on the type. For
2376      example, if TYPE is 'circle', PARAM will   contain [x0 y0 R].
2377
2378      Examples :
2379             drawShape('circle', [20 10 30]);
2380             Draw circle centered on [20 10] with radius 10.
2381             drawShape('rect', [20 20 40 10 pi/3]);
2382             Draw rectangle centered on [20 20] with length 40 and width 10, and
2383             oriented pi/3 wrt axis Ox.
2384
2385      drawShape(..., OPTION)   also specifies drawing options. OPTION
2386      can be 'draw' (default) or   'fill'.
2387
2388
2389
2390
2391 # name: <cell-element>
2392 # type: sq_string
2393 # elements: 1
2394 # length: 48
2395 Draw various types of shapes (circles, polygons.
2396
2397
2398
2399 # name: <cell-element>
2400 # type: sq_string
2401 # elements: 1
2402 # length: 9
2403 edgeAngle
2404
2405
2406 # name: <cell-element>
2407 # type: sq_string
2408 # elements: 1
2409 # length: 520
2410  -- Function File: THETA = edgeAngle(EDGE)
2411      Return angle of edge
2412
2413      A = edgeAngle(EDGE)   Returns the angle between horizontal,
2414      right-axis and the edge EDGE.    Angle is given in radians,
2415      between 0 and 2*pi, in counter-clockwise   direction.    Notation
2416      for edge is [x1 y1 x2 y2] (coordinates of starting and ending
2417      points).
2418
2419      Example   p1 = [10 20];   p2 = [30 40];   rad2deg(edgeAngle([p1
2420      p2]))   ans =       45
2421
2422      See also: edges2d, angles2d, edgeAngle, lineAngle, edgeLength
2423
2424
2425
2426
2427
2428 # name: <cell-element>
2429 # type: sq_string
2430 # elements: 1
2431 # length: 21
2432 Return angle of edge
2433
2434
2435
2436
2437 # name: <cell-element>
2438 # type: sq_string
2439 # elements: 1
2440 # length: 10
2441 edgeLength
2442
2443
2444 # name: <cell-element>
2445 # type: sq_string
2446 # elements: 1
2447 # length: 436
2448  -- Function File: LEN =  edgeLength (EDGE)
2449      Return length of an edge
2450
2451      L = edgeLength(EDGE);   Returns the length of an edge, with
2452      parametric representation:   [x1 y1 x2 y2].
2453
2454      The function also works for several edges, in this case input is a
2455       [N*4] array, containing parametric representation of each edge,
2456      and   output is a [N*1] array containing length of each edge.
2457
2458      See also: edges2d, edgeAngle
2459
2460
2461
2462
2463
2464 # name: <cell-element>
2465 # type: sq_string
2466 # elements: 1
2467 # length: 25
2468 Return length of an edge
2469
2470
2471
2472
2473 # name: <cell-element>
2474 # type: sq_string
2475 # elements: 1
2476 # length: 12
2477 edgePosition
2478
2479
2480 # name: <cell-element>
2481 # type: sq_string
2482 # elements: 1
2483 # length: 1194
2484  -- Function File: D =  edgePosition (POINT, EDGE)
2485      Return position of a point on an edge
2486
2487      POS = edgePosition(POINT, EDGE);   Computes position of point
2488      POINT on the edge EDGE, relative to the   position of edge
2489      vertices.    EDGE has the form [x1 y1 x2 y2],   POINT has the form
2490      [x y], and is assumed to belong to edge.    The position POS has
2491      meaning:     POS<0:    POINT is located before the first vertex
2492      POS=0:    POINT is located on the first vertex     0<POS<1:  POINT
2493      is located between the 2 vertices (on the edge)     POS=1:
2494      POINT is located on the second vertex     POS<0:    POINT is
2495      located after the second vertex
2496
2497      POS = edgePosition(POINT, EDGES);   If EDGES is an array of NL
2498      edges, return NL positions, corresponding to   each edge.
2499
2500      POS = edgePosition(POINTS, EDGE);   If POINTS is an array of NP
2501      points, return NP positions, corresponding   to each point.
2502
2503      POS = edgePosition(POINTS, EDGES);   If POINTS is an array of NP
2504      points and edgeS is an array of NL edges,   return an array of [NP
2505      NL] position, corresponding to each couple   point-edge.
2506
2507      See also: edges2d, createEdge, onEdge
2508
2509
2510
2511
2512
2513 # name: <cell-element>
2514 # type: sq_string
2515 # elements: 1
2516 # length: 38
2517 Return position of a point on an edge
2518
2519
2520
2521
2522 # name: <cell-element>
2523 # type: sq_string
2524 # elements: 1
2525 # length: 10
2526 edgeToLine
2527
2528
2529 # name: <cell-element>
2530 # type: sq_string
2531 # elements: 1
2532 # length: 392
2533  -- Function File: LINE =  edgeToLine (EDGE)
2534      Convert an edge to a straight line
2535
2536      LINE = edgeToLine(EDGE);   Returns the line containing the edge
2537      EDGE.
2538
2539      Example       edge = [2 3 4 5];       line = edgeToLine(edge);
2540       figure(1); hold on; axis([0 10 0 10]);       drawLine(line,
2541      'color', 'g')       drawEdge(edge, 'linewidth', 2)
2542
2543      See also: edges2d, lines2d
2544
2545
2546
2547
2548
2549 # name: <cell-element>
2550 # type: sq_string
2551 # elements: 1
2552 # length: 35
2553 Convert an edge to a straight line
2554
2555
2556
2557
2558 # name: <cell-element>
2559 # type: sq_string
2560 # elements: 1
2561 # length: 7
2562 edges2d
2563
2564
2565 # name: <cell-element>
2566 # type: sq_string
2567 # elements: 1
2568 # length: 492
2569  -- Function File: edges2d ()
2570      Description of functions operating on planar edges
2571
2572      An edge is represented by the corodinate of its end points:   EDGE
2573      = [X1 Y1 X2 Y2];
2574
2575      A set of edges is represented by a N*4 array, each row
2576      representing an   edge.
2577
2578      See also: lines2d, rays2d, points2d   createEdge, edgeAngle,
2579      edgeLength, edgeToLine, midPoint   intersectEdges,
2580      intersectLineEdge, isPointOnEdge   clipEdge, transformEdge
2581      drawEdge, drawCenteredEdge
2582
2583
2584
2585
2586
2587 # name: <cell-element>
2588 # type: sq_string
2589 # elements: 1
2590 # length: 51
2591 Description of functions operating on planar edges
2592
2593
2594
2595
2596 # name: <cell-element>
2597 # type: sq_string
2598 # elements: 1
2599 # length: 11
2600 ellipse2cov
2601
2602
2603 # name: <cell-element>
2604 # type: sq_string
2605 # elements: 1
2606 # length: 672
2607  -- Function File: K =  ellipse2cov (ELLI)
2608  -- Function File: K =  ellipse2cov (RA, RB)
2609  -- Function File: K =  ellipse2cov (..., THETA)
2610      Calculates covariance matrix from ellipse.
2611
2612      If only one input is given, ELLI must define an ellipse as
2613      described in `ellipses2d'.  If two inputs are given, RA and RB
2614      define the half-lenght of the axes.  If a third input is given,
2615      THETA must be the angle of rotation of the ellipse in radians, and
2616      in counter-clockwise direction.
2617
2618      The output K contains the covariance matrix define by the ellipse.
2619
2620      Run `demo ellipse2cov' to see an example.
2621
2622      See also: ellipses2d, cov2ellipse, drawEllipse
2623
2624
2625
2626
2627
2628 # name: <cell-element>
2629 # type: sq_string
2630 # elements: 1
2631 # length: 42
2632 Calculates covariance matrix from ellipse.
2633
2634
2635
2636 # name: <cell-element>
2637 # type: sq_string
2638 # elements: 1
2639 # length: 16
2640 ellipseAsPolygon
2641
2642
2643 # name: <cell-element>
2644 # type: sq_string
2645 # elements: 1
2646 # length: 731
2647  -- Function File: P =  ellipseAsPolygon (ELL, N)
2648      Convert an ellipse into a series of points
2649
2650      P = ellipseAsPolygon(ELL, N);   converts ELL given as [x0 y0 a b]
2651      or [x0 y0 a b theta] into a polygon   with N edges. The result P
2652      is (N+1)-by-2 array containing coordinates   of the N+1 vertices
2653      of the polygon.    The resulting polygon is closed, i.e. the last
2654      point is the same as the   first one.
2655
2656      P = ellipseAsPolygon(ELL);   Use a default number of edges equal
2657      to 72. This result in one piont for   each 5 degrees.
2658
2659      [X Y] = ellipseAsPolygon(...);   Return the coordinates o
2660      fvertices in two separate arrays.
2661
2662      See also: ellipses2d, circleAsPolygon, rectAsPolygon, drawEllipse
2663
2664
2665
2666
2667
2668 # name: <cell-element>
2669 # type: sq_string
2670 # elements: 1
2671 # length: 43
2672 Convert an ellipse into a series of points
2673
2674
2675
2676
2677 # name: <cell-element>
2678 # type: sq_string
2679 # elements: 1
2680 # length: 10
2681 ellipses2d
2682
2683
2684 # name: <cell-element>
2685 # type: sq_string
2686 # elements: 1
2687 # length: 377
2688  -- Function File: ellipses2d ()
2689      Description of functions operating on ellipses.
2690
2691      Ellipses are represented by their center, the length of their 2
2692      semi-axes length, and their angle from the Ox direction (in
2693      degrees).    E = [XC YC A B THETA];
2694
2695      See also: circles2d, inertiaEllipse, isPointInEllipse,
2696      ellipseAsPolygon   drawEllipse, drawEllipseArc
2697
2698
2699
2700
2701
2702 # name: <cell-element>
2703 # type: sq_string
2704 # elements: 1
2705 # length: 47
2706 Description of functions operating on ellipses.
2707
2708
2709
2710 # name: <cell-element>
2711 # type: sq_string
2712 # elements: 1
2713 # length: 15
2714 enclosingCircle
2715
2716
2717 # name: <cell-element>
2718 # type: sq_string
2719 # elements: 1
2720 # length: 462
2721  -- Function File: CIRCLE =  enclosingCircle (PTS)
2722      Find the minimum circle enclosing a set of points.
2723
2724      CIRCLE = enclosingCircle(POINTS);   compute cirlce CIRCLE=[xc yc
2725      r] which enclose all points POINTS given   as an [Nx2] array.
2726
2727      Rewritten from a file from           Yazan Ahed   which was
2728      rewritten from a Java applet by Shripad Thite :
2729      `http://heyoka.cs.uiuc.edu/~thite/mincircle/'
2730
2731      See also: circles2d, points2d, boxes2d
2732
2733
2734
2735
2736
2737 # name: <cell-element>
2738 # type: sq_string
2739 # elements: 1
2740 # length: 50
2741 Find the minimum circle enclosing a set of points.
2742
2743
2744
2745 # name: <cell-element>
2746 # type: sq_string
2747 # elements: 1
2748 # length: 20
2749 fitAffineTransform2d
2750
2751
2752 # name: <cell-element>
2753 # type: sq_string
2754 # elements: 1
2755 # length: 397
2756  -- Function File: T =  fitAffineTransform2d (PTS1, PTS2)
2757      Fit an affine transform using two point sets.
2758
2759      Example
2760
2761             N = 10;
2762             pts = rand(N, 2)*10;
2763             trans = createRotation(3, 4, pi/4);
2764             pts2 = transformPoint(pts, trans);
2765             pts3 = pts2 + randn(N, 2)*2;
2766             fitted = fitAffineTransform2d(pts, pts2)
2767
2768      See also: transforms2d
2769
2770
2771
2772
2773
2774 # name: <cell-element>
2775 # type: sq_string
2776 # elements: 1
2777 # length: 45
2778 Fit an affine transform using two point sets.
2779
2780
2781
2782 # name: <cell-element>
2783 # type: sq_string
2784 # elements: 1
2785 # length: 15
2786 geom2d_Contents
2787
2788
2789 # name: <cell-element>
2790 # type: sq_string
2791 # elements: 1
2792 # length: 8910
2793  -- Function File: geom2d_Contents ()
2794      Geometry 2D Toolbox Version 1.2.0 21-Oct-2011 .
2795
2796         Library to handle and visualize geometric primitives such as
2797      points,    lines, circles and ellipses, polygons...
2798
2799      The goal is to provide a low-level library for manipulating
2800      geometrical   primitives, making easier the development of more
2801      complex geometric   algorithms.
2802
2803      Most functions works for planar shapes, but some ones have been
2804      extended to 3D or to any dimension.
2805
2806      Points   points2d             - Description of functions operating
2807      on points   clipPoints           - Clip a set of points by a box
2808      centroid             - Compute centroid (center of mass) of a set
2809      of points   midPoint             - Middle point of two points or
2810      of an edge   isCounterClockwise   - Compute relative orientation
2811      of 3 points   polarPoint           - Create a point from polar
2812      coordinates (rho + theta)   angle2Points         - Compute
2813      horizontal angle between 2 points   angle3Points         - Compute
2814      oriented angle made by 3 points   angleSort            - Sort
2815      points in the plane according to their angle to origin
2816      distancePoints       - Compute distance between two points
2817      minDistancePoints    - Minimal distance between several points
2818      transformPoint       - Transform a point with an affine transform
2819      drawPoint            - Draw the point on the axis.
2820
2821      Vectors   vectors2d            - Description of functions
2822      operating on plane vectors   createVector         - Create a
2823      vector from two points   vectorNorm           - Compute norm of a
2824      vector, or of a set of vectors   vectorAngle          - Angle of a
2825      vector, or between 2 vectors   normalizeVector      - Normalize a
2826      vector to have norm equal to 1   isPerpendicular      - Check
2827      orthogonality of two vectors   isParallel           - Check
2828      parallelism of two vectors   transformVector      - Transform a
2829      vector with an affine transform   rotateVector         - Rotate a
2830      vector by a given angle
2831
2832      Straight lines   lines2d              - Description of functions
2833      operating on planar lines   createLine           - Create a
2834      straight line from 2 points, or from other inputs   medianLine
2835           - Create a median line between two points   cartesianLine
2836        - Create a straight line from cartesian equation coefficients
2837      orthogonalLine       - Create a line orthogonal to another one.
2838      parallelLine         - Create a line parallel to another one.
2839      intersectLines       - Return all intersection points of N lines
2840      in 2D   lineAngle            - Computes angle between two straight
2841      lines   linePosition         - Position of a point on a line
2842      lineFit              - Fit a straight line to a set of points
2843      clipLine             - Clip a line with a box   reverseLine
2844       - Return same line but with opposite orientation   transformLine
2845           - Transform a line with an affine transform   drawLine
2846          - Draw the line on the current axis
2847
2848      Edges (line segments between 2 points)   edges2d              -
2849      Description of functions operating on planar edges   createEdge
2850            - Create an edge between two points, or from a line
2851      edgeToLine           - Convert an edge to a straight line
2852      edgeAngle            - Return angle of edge   edgeLength
2853      - Return length of an edge   midPoint             - Middle point
2854      of two points or of an edge   edgePosition         - Return
2855      position of a point on an edge   clipEdge             - Clip an
2856      edge with a rectangular box   reverseEdge          - Intervert the
2857      source and target vertices of edge   intersectEdges       - Return
2858      all intersections between two set of edges   intersectLineEdge
2859      - Return intersection between a line and an edge   transformEdge
2860          - Transform an edge with an affine transform   drawEdge
2861          - Draw an edge given by 2 points   drawCenteredEdge     - Draw
2862      an edge centered on a point
2863
2864      Rays   rays2d               - Description of functions operating
2865      on planar rays   createRay            - Create a ray (half-line),
2866      from various inputs   bisector             - Return the bisector
2867      of two lines, or 3 points   clipRay              - Clip a ray with
2868      a box   drawRay              - Draw a ray on the current axis
2869
2870      Relations between points and lines   distancePointEdge    -
2871      Minimum distance between a point and an edge   distancePointLine
2872      - Minimum distance between a point and a line   projPointOnLine
2873       - Project of a point orthogonally onto a line   pointOnLine
2874        - Create a point on a line at a given position on the line
2875      isPointOnLine        - Test if a point belongs to a line
2876      isPointOnEdge        - Test if a point belongs to an edge
2877      isPointOnRay         - Test if a point belongs to a ray
2878      isLeftOriented       - Test if a point is on the left side of a
2879      line
2880
2881      Circles   circles2d            - Description of functions
2882      operating on circles   createCircle         - Create a circle from
2883      2 or 3 points   createDirectedCircle - Create a directed circle
2884      intersectCircles     - Intersection points of two circles
2885      intersectLineCircle  - Intersection point(s) of a line and a circle
2886       circleAsPolygon      - Convert a circle into a series of points
2887      circleArcAsCurve     - Convert a circle arc into a series of points
2888       isPointInCircle      - Test if a point is located inside a given
2889      circle   isPointOnCircle      - Test if a point is located on a
2890      given circle.    enclosingCircle      - Find the minimum circle
2891      enclosing a set of points.    radicalAxis          - Compute the
2892      radical axis (or radical line) of 2 circles   drawCircle
2893      - Draw a circle on the current axis   drawCircleArc        - Draw
2894      a circle arc on the current axis
2895
2896      Ellipses   ellipses2d           - Description of functions
2897      operating on ellipses   inertiaEllipse       - Inertia ellipse of
2898      a set of points   isPointInEllipse     - Check if a point is
2899      located inside a given ellipse   ellipseAsPolygon     - Convert an
2900      ellipse into a series of points   drawEllipse          - Draw an
2901      ellipse on the current axis   drawEllipseArc       - Draw an
2902      ellipse arc on the current axis
2903
2904      Geometric transforms   transforms2d         - Description of
2905      functions operating on transforms   createTranslation    - Create
2906      the 3*3 matrix of a translation   createRotation       - Create
2907      the 3*3 matrix of a rotation   createScaling        - Create the
2908      3*3 matrix of a scaling in 2 dimensions   createHomothecy      -
2909      Create the the 3x3 matrix of an homothetic transform
2910      createBasisTransform - Compute matrix for transforming a basis
2911      into another basis   createLineReflection - Create the the 3x3
2912      matrix of a line reflection   fitAffineTransform2d - Fit an affine
2913      transform using two point sets
2914
2915      Angles   angles2d             - Description of functions for
2916      manipulating angles   normalizeAngle       - Normalize an angle
2917      value within a 2*PI interval   angleAbsDiff         - Absolute
2918      difference between two angles   angleDiff            - Difference
2919      between two angles   deg2rad              - Convert angle from
2920      degrees to radians   rad2deg              - Convert angle from
2921      radians to degrees
2922
2923      Boxes   boxes2d              - Description of functions operating
2924      on bounding boxes   intersectBoxes       - Intersection of two
2925      bounding boxes   mergeBoxes           - Merge two boxes, by
2926      computing their greatest extent   randomPointInBox     - Generate
2927      random point within a box   drawBox              - Draw a box
2928      defined by coordinate extents
2929
2930      Various drawing functions   drawBezierCurve      - Draw a cubic
2931      bezier curve defined by 4 control points   drawParabola         -
2932      Draw a parabola on the current axis   drawOrientedBox      - Draw
2933      centered oriented rectangle   drawRect             - Draw
2934      rectangle on the current axis   drawArrow            - Draw an
2935      arrow on the current axis   drawLabels           - Draw labels at
2936      specified positions   drawShape            - Draw various types of
2937      shapes (circles, polygons...)
2938
2939      Other shapes   squareGrid           - Generate equally spaces
2940      points in plane.    hexagonalGrid        - Generate hexagonal grid
2941      of points in the plane.    triangleGrid         - Generate
2942      triangular grid of points in the plane.    crackPattern         -
2943      Create a (bounded) crack pattern tessellation   crackPattern2
2944       - Create a (bounded) crack pattern tessellation
2945
2946      Credits:   * function 'enclosingCircle' rewritten from a file from
2947      Yazan Ahed    , available on Matlab File Exchange
2948
2949
2950
2951
2952
2953 # name: <cell-element>
2954 # type: sq_string
2955 # elements: 1
2956 # length: 30
2957 Geometry 2D Toolbox Version 1.
2958
2959
2960
2961 # name: <cell-element>
2962 # type: sq_string
2963 # elements: 1
2964 # length: 13
2965 hexagonalGrid
2966
2967
2968 # name: <cell-element>
2969 # type: sq_string
2970 # elements: 1
2971 # length: 458
2972  -- Function File: PTS =  hexagonalGrid (BOUNDS, ORIGIN, SIZE)
2973      Generate hexagonal grid of points in the plane.
2974
2975      usage   PTS = hexagonalGrid(BOUNDS, ORIGIN, SIZE)   generate
2976      points, lying in the window defined by BOUNDS (=[xmin ymin   xmax
2977      ymax]), starting from origin with a constant step equal to size.
2978      SIZE is constant and is equals to the length of the sides of each
2979      hexagon.
2980
2981      TODO: add possibility to use rotated grid
2982
2983
2984
2985
2986 # name: <cell-element>
2987 # type: sq_string
2988 # elements: 1
2989 # length: 47
2990 Generate hexagonal grid of points in the plane.
2991
2992
2993
2994 # name: <cell-element>
2995 # type: sq_string
2996 # elements: 1
2997 # length: 14
2998 inertiaEllipse
2999
3000
3001 # name: <cell-element>
3002 # type: sq_string
3003 # elements: 1
3004 # length: 1098
3005  -- Function File: ELL =  inertiaEllipse (PTS)
3006      Inertia ellipse of a set of points
3007
3008      ELL = inertiaEllipse(PTS);   where PTS is a N*2 array containing
3009      coordinates of N points, computes   the inertia ellispe of the set
3010      of points.
3011
3012      The result has the form:   ELL = [XC YC A B THETA],   with XC and
3013      YC being the center of mass of the point set, A and B are   the
3014      lengths of the inertia ellipse (see below), and THETA is the angle
3015       of the main inertia axis with the horizontal (counted in degrees
3016      between 0 and 180).    A and B are the standard deviations of the
3017      point coordinates when   ellipse is aligned with the inertia axes.
3018
3019             pts = randn(100, 2);
3020             pts = transformPoint(pts, createScaling(5, 2));
3021             pts = transformPoint(pts, createRotation(pi/6));
3022             pts = transformPoint(pts, createTranslation(3, 4));
3023             ell = inertiaEllipse(pts);
3024             figure(1); clf; hold on;
3025             drawPoint(pts);
3026             drawEllipse(ell, 'linewidth', 2, 'color', 'r');
3027
3028      See also: ellipses2d, drawEllipse
3029
3030
3031
3032
3033
3034 # name: <cell-element>
3035 # type: sq_string
3036 # elements: 1
3037 # length: 35
3038 Inertia ellipse of a set of points
3039
3040
3041
3042
3043 # name: <cell-element>
3044 # type: sq_string
3045 # elements: 1
3046 # length: 14
3047 intersectBoxes
3048
3049
3050 # name: <cell-element>
3051 # type: sq_string
3052 # elements: 1
3053 # length: 303
3054  -- Function File: BOX = intersectBoxes (BOX1, BOX2)
3055      Intersection of two bounding boxes.
3056
3057      Example
3058
3059             box1 = [5 20 5 30];
3060             box2 = [0 15 0 15];
3061             intersectBoxes(box1, box2)
3062             ans =
3063                 5 15 5 15
3064
3065      See also: boxes2d, drawBox, mergeBoxes
3066
3067
3068
3069
3070
3071 # name: <cell-element>
3072 # type: sq_string
3073 # elements: 1
3074 # length: 35
3075 Intersection of two bounding boxes.
3076
3077
3078
3079 # name: <cell-element>
3080 # type: sq_string
3081 # elements: 1
3082 # length: 16
3083 intersectCircles
3084
3085
3086 # name: <cell-element>
3087 # type: sq_string
3088 # elements: 1
3089 # length: 1236
3090  -- Function File: POINTS =  intersectCircles (CIRCLE1, CIRCLE2)
3091      Intersection points of two circles.
3092
3093      POINTS = intersectCircles(CIRCLE1, CIRCLE2)   Computes the
3094      intersetion point of the two circles CIRCLE1 and CIRCLE1.    Both
3095      circles are given with format: [XC YC R], with (XC,YC) being the
3096      coordinates of the center and R being the radius.    POINTS is a
3097      2-by-2 array, containing coordinate of an intersection   point on
3098      each row.    In the case of tangent circles, the intersection is
3099      returned twice. It   can be simplified by using the 'unique'
3100      function.
3101
3102      Example     % intersection points of two distant circles     c1 =
3103      [0  0 10];     c2 = [10 0 10];     pts = intersectCircles(c1, c2)
3104        pts =         5   -8.6603         5    8.6603
3105
3106      % intersection points of two tangent circles     c1 = [0  0 10];
3107       c2 = [20 0 10];     pts = intersectCircles(c1, c2)     pts =
3108        10    0         10    0     pts2 = unique(pts, 'rows')     pts2 =
3109             10    0
3110
3111      References
3112      http://local.wasp.uwa.edu.au/~pbourke/geometry/2circle/
3113      http://mathworld.wolfram.com/Circle-CircleIntersection.html
3114
3115      See also: circles2d, intersectLineCircle, radicalAxis
3116
3117
3118
3119
3120
3121 # name: <cell-element>
3122 # type: sq_string
3123 # elements: 1
3124 # length: 35
3125 Intersection points of two circles.
3126
3127
3128
3129 # name: <cell-element>
3130 # type: sq_string
3131 # elements: 1
3132 # length: 14
3133 intersectEdges
3134
3135
3136 # name: <cell-element>
3137 # type: sq_string
3138 # elements: 1
3139 # length: 739
3140  -- Function File: POINT =  intersectEdges (EDGE1, EDGE2)
3141      Return all intersections between two set of edges
3142
3143      P = intersectEdges(E1, E2);   returns the intersection point of
3144      lines L1 and L2. E1 and E2 are 1-by-4   arrays, containing
3145      parametric representation of each edge (in the form   [x1 y1 x2
3146      y2], see 'createEdge' for details).
3147
3148      In case of colinear edges, returns [Inf Inf].    In case of
3149      parallel but not colinear edges, returns [NaN NaN].
3150
3151      If each input is [N*4] array, the result is a [N*2] array
3152      containing   intersections of each couple of edges.    If one of
3153      the input has N rows and the other 1 row, the result is a   [N*2]
3154      array.
3155
3156      See also: edges2d, intersectLines
3157
3158
3159
3160
3161
3162 # name: <cell-element>
3163 # type: sq_string
3164 # elements: 1
3165 # length: 50
3166 Return all intersections between two set of edges
3167
3168
3169
3170
3171 # name: <cell-element>
3172 # type: sq_string
3173 # elements: 1
3174 # length: 19
3175 intersectLineCircle
3176
3177
3178 # name: <cell-element>
3179 # type: sq_string
3180 # elements: 1
3181 # length: 772
3182  -- Function File: POINTS =  intersectLineCircle (LINE, CIRCLE)
3183      Intersection point(s) of a line and a circle
3184
3185      INTERS = intersectLineCircle(LINE, CIRCLE);   Returns a 2-by-2
3186      array, containing on each row the coordinates of an   intersection
3187      point. If the line and circle do not intersect, the result   is
3188      filled with NaN.
3189
3190      Example   % base point   center = [10 0];   % create vertical line
3191       l1 = [center 0 1];   % circle   c1 = [center 5];   pts =
3192      intersectLineCircle(l1, c1)   pts =       10   -5       10    5
3193      % draw the result   figure; clf; hold on;   axis([0 20 -10 10]);
3194      drawLine(l1);   drawCircle(c1);   drawPoint(pts, 'rx');   axis
3195      equal;
3196
3197      See also: lines2d, circles2d, intersectLines, intersectCircles
3198
3199
3200
3201
3202
3203 # name: <cell-element>
3204 # type: sq_string
3205 # elements: 1
3206 # length: 45
3207 Intersection point(s) of a line and a circle
3208
3209
3210
3211
3212 # name: <cell-element>
3213 # type: sq_string
3214 # elements: 1
3215 # length: 17
3216 intersectLineEdge
3217
3218
3219 # name: <cell-element>
3220 # type: sq_string
3221 # elements: 1
3222 # length: 868
3223  -- Function File: POINT =  intersecLineEdge (LINE, EDGE)
3224      Return intersection between a line and an edge.
3225
3226      Returns the intersection point of lines LINE and edge EDGE.
3227      LINE is a 1x4 array containing parametric representation of the
3228      line   (in the form [x0 y0 dx dy], see `createLine' for details).
3229       EDGE is a 1x4 array containing coordinates of first and second
3230      point   (in the form [x1 y1 x2 y2], see `createEdge' for details).
3231
3232      In case of colinear line and edge, returns [Inf Inf].    If line
3233      does not intersect edge, returns [NaN NaN].
3234
3235      If each input is [N*4] array, the result is a [N*2] array
3236      containing   intersections for each couple of edge and line.    If
3237      one of the input has N rows and the other 1 row, the result is a
3238      [N*2] array.
3239
3240      See also: lines2d, edges2d, intersectEdges, intersectLine
3241
3242
3243
3244
3245
3246 # name: <cell-element>
3247 # type: sq_string
3248 # elements: 1
3249 # length: 47
3250 Return intersection between a line and an edge.
3251
3252
3253
3254 # name: <cell-element>
3255 # type: sq_string
3256 # elements: 1
3257 # length: 14
3258 intersectLines
3259
3260
3261 # name: <cell-element>
3262 # type: sq_string
3263 # elements: 1
3264 # length: 1143
3265  -- Function File: POINT = intersectLines (LINE1, LINE2)
3266  -- Function File: POINT = intersectLines (LINE1, LINE2,EPS)
3267      Return all intersection points of N lines in 2D.
3268
3269      Returns the intersection point of lines LINE1 and LINE2.  LINE1
3270      and LINE2 are [1*4]   arrays, containing parametric representation
3271      of each line (in the form   [x0 y0 dx dy], see `createLine' for
3272      details).
3273
3274      In case of colinear lines, returns [Inf Inf].    In case of
3275      parallel but not colinear lines, returns [NaN NaN].
3276
3277      If each input is [N*4] array, the result is a [N*2] array
3278      containing   intersections of each couple of lines.    If one of
3279      the input has N rows and the other 1 row, the result is a   [N*2]
3280      array.
3281
3282      A third input argument specifies the tolerance for detecting
3283      parallel lines.  Default is 1e-14.
3284
3285      Example
3286
3287             line1 = createLine([0 0], [10 10]);
3288             line2 = createLine([0 10], [10 0]);
3289             point = intersectLines(line1, line2)
3290             point =
3291                 5   5
3292
3293      See also: lines2d, edges2d, intersectEdges, intersectLineEdge,
3294      intersectLineCircle
3295
3296
3297
3298
3299
3300 # name: <cell-element>
3301 # type: sq_string
3302 # elements: 1
3303 # length: 48
3304 Return all intersection points of N lines in 2D.
3305
3306
3307
3308 # name: <cell-element>
3309 # type: sq_string
3310 # elements: 1
3311 # length: 18
3312 isCounterClockwise
3313
3314
3315 # name: <cell-element>
3316 # type: sq_string
3317 # elements: 1
3318 # length: 1212
3319  -- Function File: CCW =  isCounterClockwise (P1, P2, P3)
3320  -- Function File: CCW =  isCounterClockwise (P1, P2, P3,TOL)
3321      Compute relative orientation of 3 points
3322
3323      Computes the orientation of the 3 points. The returns is:   +1 if
3324      the path  P1-> P2-> P3 turns Counter-Clockwise (i.e., the point  P3
3325           is located "on the left" of the line  P1- P2)   -1 if the
3326      path turns Clockwise (i.e., the point  P3 lies "on the right"
3327      of the line  P1- P2)   0  if the point  P3 is located on the line
3328      segment [ P1  P2].
3329
3330      This function can be used in more complicated algorithms:
3331      detection of   line segment intersections, convex hulls, point in
3332      triangle...
3333
3334      CCW = isCounterClockwise( P1,  P2,  P3, EPS);   Specifies the
3335      threshold used for detecting colinearity of the 3 points.
3336      Default value is 1e-12 (absolute).
3337
3338      Example
3339
3340             isCounterClockwise([0 0], [10 0], [10 10])
3341             ans =
3342                 1
3343             isCounterClockwise([0 0], [0 10], [10 10])
3344             ans =
3345                 -1
3346             isCounterClockwise([0 0], [10 0], [5 0])
3347             ans =
3348                 0
3349
3350      See also: points2d, isPointOnLine, isPointInTriangle
3351
3352
3353
3354
3355
3356 # name: <cell-element>
3357 # type: sq_string
3358 # elements: 1
3359 # length: 41
3360 Compute relative orientation of 3 points
3361
3362
3363
3364
3365 # name: <cell-element>
3366 # type: sq_string
3367 # elements: 1
3368 # length: 14
3369 isLeftOriented
3370
3371
3372 # name: <cell-element>
3373 # type: sq_string
3374 # elements: 1
3375 # length: 343
3376  -- Function File: B =  isLeftOriented (POINT, LINE)
3377      Test if a point is on the left side of a line
3378
3379      B = isLeftOriented(POINT, LINE);   Returns TRUE if the point lies
3380      on the left side of the line with   respect to the line direction.
3381
3382      See also: lines2d, points2d, isCounterClockwise, isPointOnLine,
3383      distancePointLine
3384
3385
3386
3387
3388
3389 # name: <cell-element>
3390 # type: sq_string
3391 # elements: 1
3392 # length: 46
3393 Test if a point is on the left side of a line
3394
3395
3396
3397
3398 # name: <cell-element>
3399 # type: sq_string
3400 # elements: 1
3401 # length: 10
3402 isParallel
3403
3404
3405 # name: <cell-element>
3406 # type: sq_string
3407 # elements: 1
3408 # length: 757
3409  -- Function File: B =  isParallel (V1, V2)
3410  -- Function File: B =  isParallel (V1, V2,TOL)
3411      Check parallelism of two vectors
3412
3413      V1 and V2 are 2 row vectors of length Nd, Nd being the dimension,
3414      returns `true' if the vectors are parallel, and `false' otherwise.
3415
3416      Also works when V1 and V2 are two [NxNd] arrays with same number of
3417       rows. In this case, return a [Nx1] array containing `true' at the
3418      positions   of parallel vectors.
3419
3420      TOL specifies the accuracy of numerical computation. Default value
3421      is 1e-14.
3422
3423      Example
3424
3425             isParallel([1 2], [2 4])
3426             ans =
3427               1
3428             isParallel([1 2], [1 3])
3429             ans =
3430               0
3431
3432      See also: vectors2d, isPerpendicular, lines2d
3433
3434
3435
3436
3437
3438 # name: <cell-element>
3439 # type: sq_string
3440 # elements: 1
3441 # length: 33
3442 Check parallelism of two vectors
3443
3444
3445
3446
3447 # name: <cell-element>
3448 # type: sq_string
3449 # elements: 1
3450 # length: 15
3451 isPerpendicular
3452
3453
3454 # name: <cell-element>
3455 # type: sq_string
3456 # elements: 1
3457 # length: 791
3458  -- Function File: B =  isPerpendicular (V1, V2)
3459  -- Function File: B =  isPerpendicula (V1, V2,TOL)
3460      heck orthogonality of two vectors.
3461
3462      V1 and V2 are 2 row vectors of length Nd, Nd being the dimension,
3463      returns `true' if the vectors are perpendicular, and `false'
3464      otherwise.
3465
3466      Also works when V1 and V2 are two [NxNd] arrays with same number of
3467       rows. In this case, return a [Nx1] array containing `true' at the
3468      positions   of parallel vectors.
3469
3470      TOL specifies the accuracy of numerical computation. Default value
3471      is 1e-14.
3472
3473      Example
3474
3475             isPerpendicular([1 2 0], [0 0 2])
3476             ans =
3477               1
3478             isPerpendicular([1 2 1], [1 3 2])
3479             ans =
3480               0
3481
3482      See also: vectors2d, isParallel, lines2d
3483
3484
3485
3486
3487
3488 # name: <cell-element>
3489 # type: sq_string
3490 # elements: 1
3491 # length: 34
3492 heck orthogonality of two vectors.
3493
3494
3495
3496 # name: <cell-element>
3497 # type: sq_string
3498 # elements: 1
3499 # length: 15
3500 isPointInCircle
3501
3502
3503 # name: <cell-element>
3504 # type: sq_string
3505 # elements: 1
3506 # length: 578
3507  -- Function File: B =  isPointInCircle (POINT, CIRCLE)
3508      Test if a point is located inside a given circle
3509
3510      B = isPointInCircle(POINT, CIRCLE)   Returns true if point is
3511      located inside the circle, i.e. if distance to   circle center is
3512      lower than the circle radius.
3513
3514      B = isPointInCircle(POINT, CIRCLE, TOL)   Specifies the tolerance
3515      value
3516
3517      Example:   isPointInCircle([1 0], [0 0 1])   isPointInCircle([0
3518      0], [0 0 1])   returns true, whereas   isPointInCircle([1 1], [0 0
3519      1])   return false
3520
3521      See also: circles2d, isPointOnCircle
3522
3523
3524
3525
3526
3527 # name: <cell-element>
3528 # type: sq_string
3529 # elements: 1
3530 # length: 49
3531 Test if a point is located inside a given circle
3532
3533
3534
3535
3536 # name: <cell-element>
3537 # type: sq_string
3538 # elements: 1
3539 # length: 16
3540 isPointInEllipse
3541
3542
3543 # name: <cell-element>
3544 # type: sq_string
3545 # elements: 1
3546 # length: 599
3547  -- Function File: B =  isPointInellipse (POINT, ELLIPSE)
3548      Check if a point is located inside a given ellipse
3549
3550      B = isPointInEllipse(POINT, ELLIPSE)   Returns true if point is
3551      located inside the given ellipse.
3552
3553      B = isPointInEllipse(POINT, ELLIPSE, TOL)   Specifies the
3554      tolerance value
3555
3556      Example:   isPointInEllipse([1 0], [0 0 2 1 0])   ans =       1
3557      isPointInEllipse([0 0], [0 0 2 1 0])   ans =       1
3558      isPointInEllipse([1 1], [0 0 2 1 0])   ans =       0
3559      isPointInEllipse([1 1], [0 0 2 1 30])   ans =       1
3560
3561      See also: ellipses2d, isPointInCircle
3562
3563
3564
3565
3566
3567 # name: <cell-element>
3568 # type: sq_string
3569 # elements: 1
3570 # length: 51
3571 Check if a point is located inside a given ellipse
3572
3573
3574
3575
3576 # name: <cell-element>
3577 # type: sq_string
3578 # elements: 1
3579 # length: 15
3580 isPointOnCircle
3581
3582
3583 # name: <cell-element>
3584 # type: sq_string
3585 # elements: 1
3586 # length: 548
3587  -- Function File: B =  isPointOnCircle (POINT, CIRCLE)
3588      Test if a point is located on a given circle.
3589
3590      B = isPointOnCircle(POINT, CIRCLE)   return true if point is
3591      located on the circle, i.e. if the distance to   the circle center
3592      equals the radius up to an epsilon value.
3593
3594      B = isPointOnCircle(POINT, CIRCLE, TOL)   Specifies the tolerance
3595      value.
3596
3597      Example:   isPointOnCircle([1 0], [0 0 1])   returns true, whereas
3598       isPointOnCircle([1 1], [0 0 1])   return false
3599
3600      See also: circles2d, isPointInCircle
3601
3602
3603
3604
3605
3606 # name: <cell-element>
3607 # type: sq_string
3608 # elements: 1
3609 # length: 45
3610 Test if a point is located on a given circle.
3611
3612
3613
3614 # name: <cell-element>
3615 # type: sq_string
3616 # elements: 1
3617 # length: 13
3618 isPointOnEdge
3619
3620
3621 # name: <cell-element>
3622 # type: sq_string
3623 # elements: 1
3624 # length: 1084
3625  -- Function File: B =  isPointOnEdge (POINT, EDGE)
3626  -- Function File: B =  isPointOnEdge (POINT, EDGE, TOL)
3627  -- Function File: B =  isPointOnEdge (POINT, EDGEARRAY)
3628  -- Function File: B =  isPointOnEdge (POINTARRAY, EDGEARRAY)
3629      Test if a point belongs to an edge.
3630
3631      with POINT being [xp yp], and EDGE being [x1 y1 x2 y2], returns
3632      TRUE if   the point is located on the edge, and FALSE otherwise.
3633
3634      Specify an optilonal tolerance value TOL. The tolerance is given
3635      as a   fraction of the norm of the edge direction vector. Default
3636      is 1e-14.
3637
3638      When one of the inputs has several rows, return the result of the
3639      test   for each element of the array tested against the single
3640      parameter.
3641
3642      When both POINTARRAY and EDGEARRAY have the same number of rows,
3643      returns a column vector with the same number of rows.    When the
3644      number of rows are different and both greater than 1, returns   a
3645      Np-by-Ne matrix of booleans, containing the result for each couple
3646      of   point and edge.
3647
3648      See also: edges2d, points2d, isPointOnLine
3649
3650
3651
3652
3653
3654 # name: <cell-element>
3655 # type: sq_string
3656 # elements: 1
3657 # length: 35
3658 Test if a point belongs to an edge.
3659
3660
3661
3662 # name: <cell-element>
3663 # type: sq_string
3664 # elements: 1
3665 # length: 13
3666 isPointOnLine
3667
3668
3669 # name: <cell-element>
3670 # type: sq_string
3671 # elements: 1
3672 # length: 473
3673  -- Function File: B =  isPointOnLine (POINT, LINE)
3674      Test if a point belongs to a line
3675
3676      B = isPointOnLine(POINT, LINE)   with POINT being [xp yp], and
3677      LINE being [x0 y0 dx dy].    Returns 1 if point lies on the line,
3678      0 otherwise.
3679
3680      If POINT is an N*2 array of points, B is a N*1 array of booleans.
3681
3682      If LINE is a N*4 array of line, B is a 1*N array of booleans.
3683
3684      See also: lines2d, points2d, isPointOnEdge, isPointOnRay,
3685      angle3Points
3686
3687
3688
3689
3690
3691 # name: <cell-element>
3692 # type: sq_string
3693 # elements: 1
3694 # length: 34
3695 Test if a point belongs to a line
3696
3697
3698
3699
3700 # name: <cell-element>
3701 # type: sq_string
3702 # elements: 1
3703 # length: 12
3704 isPointOnRay
3705
3706
3707 # name: <cell-element>
3708 # type: sq_string
3709 # elements: 1
3710 # length: 393
3711  -- Function File: B =  isPointOnRay (POINT, RAY)
3712  -- Function File: B =  isPointOnRay (POINT, RAY, TOL)
3713      Test if a point belongs to a ray
3714
3715      B = isPointOnRay(POINT, RAY);  Returns `true' if point POINT
3716      belongs to the ray RAY.   POINT is given by [x y] and RAY by [x0
3717      y0 dx dy]. TOL gives the  tolerance for the calculations.
3718
3719      See also: rays2d, points2d, isPointOnLine
3720
3721
3722
3723
3724
3725 # name: <cell-element>
3726 # type: sq_string
3727 # elements: 1
3728 # length: 33
3729 Test if a point belongs to a ray
3730
3731
3732
3733
3734 # name: <cell-element>
3735 # type: sq_string
3736 # elements: 1
3737 # length: 9
3738 lineAngle
3739
3740
3741 # name: <cell-element>
3742 # type: sq_string
3743 # elements: 1
3744 # length: 527
3745  -- Function File: THETA = lineAngle(varargin)
3746      Computes angle between two straight lines
3747
3748      A = lineAngle(LINE);   Returns the angle between horizontal,
3749      right-axis and the given line.    Angle is fiven in radians,
3750      between 0 and 2*pi, in counter-clockwise   direction.
3751
3752      A = lineAngle(LINE1, LINE2);   Returns the directed angle between
3753      the two lines. Angle is given in   radians between 0 and 2*pi, in
3754      counter-clockwise direction.
3755
3756      See also: lines2d, angles2d, createLine, normalizeAngle
3757
3758
3759
3760
3761
3762 # name: <cell-element>
3763 # type: sq_string
3764 # elements: 1
3765 # length: 42
3766 Computes angle between two straight lines
3767
3768
3769
3770
3771 # name: <cell-element>
3772 # type: sq_string
3773 # elements: 1
3774 # length: 12
3775 linePosition
3776
3777
3778 # name: <cell-element>
3779 # type: sq_string
3780 # elements: 1
3781 # length: 890
3782  -- Function File: POS = linePosition (POINT, LINE)
3783      Position of a point on a line.
3784
3785      Computes position of point POINT on the line LINE, relative to
3786      origin   point and direction vector of the line.    LINE has the
3787      form [x0 y0 dx dy],   POINT has the form [x y], and is assumed to
3788      belong to line.
3789
3790      If LINE is an array of NL lines, return NL positions,
3791      corresponding to   each line.
3792
3793      If POINT is an array of NP points, return NP positions,
3794      corresponding   to each point.
3795
3796      If POINT is an array of NP points and LINES is an array of NL
3797      lines,   return an array of [NP NL] position, corresponding to
3798      each couple   point-line.
3799
3800      Example
3801
3802             line = createLine([10 30], [30 90]);
3803             linePosition([20 60], line)
3804             ans =
3805                 .5
3806
3807      See also: lines2d, createLine, projPointOnLine, isPointOnLine
3808
3809
3810
3811
3812
3813 # name: <cell-element>
3814 # type: sq_string
3815 # elements: 1
3816 # length: 30
3817 Position of a point on a line.
3818
3819
3820
3821 # name: <cell-element>
3822 # type: sq_string
3823 # elements: 1
3824 # length: 7
3825 lines2d
3826
3827
3828 # name: <cell-element>
3829 # type: sq_string
3830 # elements: 1
3831 # length: 996
3832  -- Function File: lines2d ()
3833      Description of functions operating on planar lines.
3834
3835      The term 'line' refers to a planar straight line, which is an
3836      unbounded   curve. Line segments defined between 2 points, which
3837      are bounded, are   called 'edge', and are presented in file
3838      'edges2d'.
3839
3840      A straight line is defined by a point (its origin), and a vector
3841      (its   direction). The different parameters are bundled into a row
3842      vector:   LINE = [x0 y0 dx dy];
3843
3844      A line contains all points (x,y) such that:       x = x0 + t*dx
3845        y = y0 + t*dy;   for all t between -infinity and +infinity.
3846
3847      See also: points2d, vectors2d, edges2d, rays2d   createLine,
3848      cartesianLine, medianLine, edgeToLine   orthogonalLine,
3849      parallelLine, bisector, radicalAxis   lineAngle, linePosition,
3850      projPointOnLine   isPointOnLine, distancePointLine, isLeftOriented
3851       intersectLines, intersectLineEdge, clipLine   invertLine,
3852      transformLine, drawLine   lineFit
3853
3854
3855
3856
3857
3858 # name: <cell-element>
3859 # type: sq_string
3860 # elements: 1
3861 # length: 51
3862 Description of functions operating on planar lines.
3863
3864
3865
3866 # name: <cell-element>
3867 # type: sq_string
3868 # elements: 1
3869 # length: 10
3870 medianLine
3871
3872
3873 # name: <cell-element>
3874 # type: sq_string
3875 # elements: 1
3876 # length: 1284
3877  -- Function File: LINE =  medianLine (P1, P2)
3878  -- Function File: LINE =  medianLine (PTS)
3879  -- Function File: LINE =  medianLine (EDGE)
3880      Create a median line between two points.
3881
3882      Create the median line of points P1 and P2, that is the line
3883      containing   all points located at equal distance of P1 and P2.
3884
3885      Creates the median line of 2 points, given as a 2*2 array PTS.
3886      Array has   the form:   [ [ x1 y1 ] ; [ x2 y2 ] ]
3887
3888      Creates the median of the EDGE. EDGE is a 1*4 array, containing
3889      [X1 Y1]   coordinates of first point, and [X2 Y2], the coordinates
3890      of the second   point.
3891
3892      Example
3893
3894             % Draw the median line of two points
3895               P1 = [10 20];
3896               P2 = [30 50];
3897               med = medianLine(P1, P2);
3898               figure; axis square; axis([0 100 0 100]);
3899               drawEdge([P1 P2], 'linewidth', 2, 'color', 'k');
3900               drawLine(med)
3901
3902             % Draw the median line of an edge
3903               P1 = [50 60];
3904               P2 = [80 30];
3905               edge = createEdge(P1, P2);
3906               figure; axis square; axis([0 100 0 100]);
3907               drawEdge(edge, 'linewidth', 2)
3908               med = medianLine(edge);
3909               drawLine(med)
3910
3911      See also: lines2d, createLine, orthogonalLine
3912
3913
3914
3915
3916
3917 # name: <cell-element>
3918 # type: sq_string
3919 # elements: 1
3920 # length: 40
3921 Create a median line between two points.
3922
3923
3924
3925 # name: <cell-element>
3926 # type: sq_string
3927 # elements: 1
3928 # length: 10
3929 mergeBoxes
3930
3931
3932 # name: <cell-element>
3933 # type: sq_string
3934 # elements: 1
3935 # length: 316
3936  -- Function File: BOX = mergeBoxes (BOX1, BOX2)
3937      Merge two boxes, by computing their greatest extent.
3938
3939      Example
3940
3941             box1 = [5 20 5 30];
3942             box2 = [0 15 0 15];
3943             mergeBoxes(box1, box2)
3944             ans =
3945                 0 20 0 30
3946
3947      See also: boxes2d, drawBox, intersectBoxes
3948
3949
3950
3951
3952
3953 # name: <cell-element>
3954 # type: sq_string
3955 # elements: 1
3956 # length: 52
3957 Merge two boxes, by computing their greatest extent.
3958
3959
3960
3961 # name: <cell-element>
3962 # type: sq_string
3963 # elements: 1
3964 # length: 8
3965 midPoint
3966
3967
3968 # name: <cell-element>
3969 # type: sq_string
3970 # elements: 1
3971 # length: 868
3972  -- Function File: MID =  midPoint (P1, P2)
3973  -- Function File: MID =  midPoint (EDGE)
3974  -- Function File: [MIDX, MIDY] =  midPoint (EDGE)
3975      Middle point of two points or of an edge
3976
3977      Computes the middle point of the two points P1 and P2.
3978
3979      If an edge is given, computes the middle point of the edge given
3980      by EDGE.    EDGE has the format: [X1 Y1 X2 Y2], and MID has the
3981      format [XMID YMID],   with XMID = (X1+X2)/2, and YMID = (Y1+Y2)/2.
3982
3983      If two output arguments are given, it returns the result as two
3984      separate variables or arrays.
3985
3986      Works also when EDGE is a N-by-4 array, in this case the result is
3987      a   N-by-2 array containing the midpoint of each edge.
3988
3989      Example
3990
3991             p1 = [10 20];
3992             p2 = [30 40];
3993             midPoint([p1 p2])
3994             ans =
3995                 20  30
3996
3997      See also: edges2d, points2d
3998
3999
4000
4001
4002
4003 # name: <cell-element>
4004 # type: sq_string
4005 # elements: 1
4006 # length: 41
4007 Middle point of two points or of an edge
4008
4009
4010
4011
4012 # name: <cell-element>
4013 # type: sq_string
4014 # elements: 1
4015 # length: 17
4016 minDistancePoints
4017
4018
4019 # name: <cell-element>
4020 # type: sq_string
4021 # elements: 1
4022 # length: 2407
4023  -- Function File: DIST =  minDistancePoints (PTS)
4024  -- Function File: DIST =  minDistancePoints (PTS1,PTS2)
4025  -- Function File: DIST =  minDistancePoints (...,NORM)
4026  -- Function File: [DIST I J] =  minDistancePoints (PTS1, PTS2, ...)
4027  -- Function File: [DIST J] =  minDistancePoints (PTS1, PTS2, ...)
4028      Minimal distance between several points.
4029
4030      Returns the minimum distance between all couple of points in PTS.
4031      PTS is   an array of [NxND] values, N being the number of points
4032      and ND the   dimension of the points.
4033
4034      Computes for each point in PTS1 the minimal distance to every
4035      point of   PTS2. PTS1 and PTS2 are [NxD] arrays, where N is the
4036      number of points,   and D is the dimension. Dimension must be the
4037      same for both arrays, but   number of points can be different.
4038      The result is an array the same length as PTS1.
4039
4040      When NORM is provided, it uses a user-specified norm. NORM=2 means
4041      euclidean norm (the default),   NORM=1 is the Manhattan (or
4042      "taxi-driver") distance.    Increasing NORM growing up reduces the
4043      minimal distance, with a limit   to the biggest coordinate
4044      difference among dimensions.
4045
4046      Returns indices I and J of the 2 points which are the closest. DIST
4047       verifies relation:   DIST = distancePoints(PTS(I,:), PTS(J,:));
4048
4049      If only 2 output arguments are given, it returns the indices of
4050      points which are the closest. J has the   same size as DIST. for
4051      each I It verifies the relation :   DIST(I) =
4052      distancePoints(PTS1(I,:), PTS2(J,:));
4053
4054      Examples:
4055
4056             % minimal distance between random planar points
4057                 points = rand(20,2)*100;
4058                 minDist = minDistancePoints(points);
4059
4060             % minimal distance between random space points
4061                 points = rand(30,3)*100;
4062                 [minDist ind1 ind2] = minDistancePoints(points);
4063                 minDist
4064                 distancePoints(points(ind1, :), points(ind2, :))
4065             % results should be the same
4066
4067             % minimal distance between 2 sets of points
4068                 points1 = rand(30,2)*100;
4069                 points2 = rand(30,2)*100;
4070                 [minDists inds] = minDistancePoints(points1, points2);
4071                 minDists(10)
4072                 distancePoints(points1(10, :), points2(inds(10), :))
4073             % results should be the same
4074
4075      See also: points2d, distancePoints
4076
4077
4078
4079
4080
4081 # name: <cell-element>
4082 # type: sq_string
4083 # elements: 1
4084 # length: 40
4085 Minimal distance between several points.
4086
4087
4088
4089 # name: <cell-element>
4090 # type: sq_string
4091 # elements: 1
4092 # length: 14
4093 normalizeAngle
4094
4095
4096 # name: <cell-element>
4097 # type: sq_string
4098 # elements: 1
4099 # length: 884
4100  -- Function File: ALPHA2 = normalizeAngle (ALPHA)
4101  -- Function File: ALPHA2 = normalizeAngle (ALPHA, CENTER)
4102      Normalize an angle value within a 2*PI interval
4103
4104      ALPHA2 = normalizeAngle(ALPHA);   ALPHA2 is the same as ALPHA
4105      modulo 2*PI and is positive.
4106
4107      ALPHA2 = normalizeAngle(ALPHA, CENTER);   Specifies the center of
4108      the angle interval.    If CENTER==0, the interval is [-pi ; +pi]
4109      If CENTER==PI, the interval is [0 ; 2*pi] (default).
4110
4111      Example:   % normalization between 0 and 2*pi (default)
4112      normalizeAngle(5*pi)   ans =       3.1416
4113
4114      % normalization between -pi and +pi   normalizeAngle(7*pi/2, 0)
4115      ans =       -1.5708
4116
4117      References   Follows the same convention as apache commons
4118      library, see:
4119      http://commons.apache.org/math/api-2.2/org/apache/commons/math/util/MathUtils.html%%
4120
4121      See also: vectorAngle, lineAngle
4122
4123
4124
4125
4126
4127 # name: <cell-element>
4128 # type: sq_string
4129 # elements: 1
4130 # length: 48
4131 Normalize an angle value within a 2*PI interval
4132
4133
4134
4135
4136 # name: <cell-element>
4137 # type: sq_string
4138 # elements: 1
4139 # length: 15
4140 normalizeVector
4141
4142
4143 # name: <cell-element>
4144 # type: sq_string
4145 # elements: 1
4146 # length: 503
4147  -- Function File: VN =  normalizeVector (V)
4148      Normalize a vector to have norm equal to 1
4149
4150      Returns the normalization of vector V, such that ||V|| = 1.  V can
4151      be either a row or a column vector.
4152
4153      When V is a MxN array, normalization is performed for each row of
4154      the array.
4155
4156      Example:
4157
4158             vn = normalizeVector([3 4])
4159             vn =
4160                 0.6000   0.8000
4161             vectorNorm(vn)
4162             ans =
4163                 1
4164
4165      See also: vectors2d, vectorNorm
4166
4167
4168
4169
4170
4171 # name: <cell-element>
4172 # type: sq_string
4173 # elements: 1
4174 # length: 43
4175 Normalize a vector to have norm equal to 1
4176
4177
4178
4179
4180 # name: <cell-element>
4181 # type: sq_string
4182 # elements: 1
4183 # length: 14
4184 orthogonalLine
4185
4186
4187 # name: <cell-element>
4188 # type: sq_string
4189 # elements: 1
4190 # length: 343
4191  -- Function File: PERP =  orthogonalLine (LINE, POINT)
4192      Create a line orthogonal to another one.
4193
4194      Returns the line orthogonal to the line LINE and going through the
4195       point given by POINT. Directed angle from LINE to PERP is pi/2.
4196      LINE is given as [x0 y0 dx dy] and POINT is [xp yp].
4197
4198      See also: lines2d, parallelLine
4199
4200
4201
4202
4203
4204 # name: <cell-element>
4205 # type: sq_string
4206 # elements: 1
4207 # length: 40
4208 Create a line orthogonal to another one.
4209
4210
4211
4212 # name: <cell-element>
4213 # type: sq_string
4214 # elements: 1
4215 # length: 12
4216 parallelLine
4217
4218
4219 # name: <cell-element>
4220 # type: sq_string
4221 # elements: 1
4222 # length: 565
4223  -- Function File: RES =  parallelLine (LINE, POINT)
4224  -- Function File: RES =  parallelLine (LINE, DIST)
4225      Create a line parallel to another one.
4226
4227      Returns the line with same direction vector than LINE and going
4228      through   the point given by POINT.    LINE is given as [x0 y0 dx
4229      dy] and POINT is [xp yp].
4230
4231      Uses relative distance to specify position. The new line will be
4232      located at distance DIST, counted positive in the right side of
4233      LINE   and negative in the left side.
4234
4235      See also: lines2d, orthogonalLine, distancePointLine
4236
4237
4238
4239
4240
4241 # name: <cell-element>
4242 # type: sq_string
4243 # elements: 1
4244 # length: 38
4245 Create a line parallel to another one.
4246
4247
4248
4249 # name: <cell-element>
4250 # type: sq_string
4251 # elements: 1
4252 # length: 11
4253 pointOnLine
4254
4255
4256 # name: <cell-element>
4257 # type: sq_string
4258 # elements: 1
4259 # length: 451
4260  -- Function File: POINT =  pointOnLine (LINE, D)
4261      Create a point on a line at a given position on the line.
4262
4263      Creates the point belonging to the line LINE, and located at the
4264      distance D from the line origin.    LINE has the form [x0 y0 dx
4265      dy].    LINE and D should have the same number N of rows. The
4266      result will have   N rows and 2 column (x and y positions).
4267
4268      See also: lines2d, points2d, onLine, onLine, linePosition
4269
4270
4271
4272
4273
4274 # name: <cell-element>
4275 # type: sq_string
4276 # elements: 1
4277 # length: 57
4278 Create a point on a line at a given position on the line.
4279
4280
4281
4282 # name: <cell-element>
4283 # type: sq_string
4284 # elements: 1
4285 # length: 8
4286 points2d
4287
4288
4289 # name: <cell-element>
4290 # type: sq_string
4291 # elements: 1
4292 # length: 591
4293  -- Function File: points2d ()
4294      Description of functions operating on points.
4295
4296      A point is defined by its two cartesian coordinate, put into a row
4297       vector of 2 elements:   P = [x y];
4298
4299      Several points are stores in a matrix with two columns, one for the
4300       x-coordinate, one for the y-coordinate.    PTS = [x1 y1 ; x2 y2 ;
4301      x3 y3];
4302
4303      Example   P = [5 6];
4304
4305      See also: centroid, midPoint, polarPoint, pointOnLine
4306      isCounterClockwise, angle2Points, angle3Points, angleSort
4307      distancePoints, minDistancePoints   transformPoint, clipPoints,
4308      drawPoint
4309
4310
4311
4312
4313
4314 # name: <cell-element>
4315 # type: sq_string
4316 # elements: 1
4317 # length: 45
4318 Description of functions operating on points.
4319
4320
4321
4322 # name: <cell-element>
4323 # type: sq_string
4324 # elements: 1
4325 # length: 10
4326 polarPoint
4327
4328
4329 # name: <cell-element>
4330 # type: sq_string
4331 # elements: 1
4332 # length: 760
4333  -- Function File: POINT =  polarPoint (RHO, THETA)
4334  -- Function File: POINT =  polarPoint (THETA)
4335  -- Function File: POINT =  polarPoint (POINT, RHO, THETA)
4336  -- Function File: POINT =  polarPoint (X0, Y0, RHO, THETA)
4337      Create a point from polar coordinates (rho + theta)
4338
4339      Creates a point using polar coordinate. THETA is angle with
4340      horizontal   (counted counter-clockwise, and in radians), and RHO
4341      is the distance to   origin. If only angle is given radius RHO is
4342      assumed to be 1.
4343
4344      If a point is given, adds the coordinate of the point to the
4345      coordinate of the specified   point. For example, creating a point
4346      with :     P = polarPoint([10 20], 30, pi/2);   will give a result
4347      of [40 20].
4348
4349      See also: points2d
4350
4351
4352
4353
4354
4355 # name: <cell-element>
4356 # type: sq_string
4357 # elements: 1
4358 # length: 52
4359 Create a point from polar coordinates (rho + theta)
4360
4361
4362
4363
4364 # name: <cell-element>
4365 # type: sq_string
4366 # elements: 1
4367 # length: 15
4368 projPointOnLine
4369
4370
4371 # name: <cell-element>
4372 # type: sq_string
4373 # elements: 1
4374 # length: 566
4375  -- Function File: POINT =  projPointOnLine (PT1, LINE)
4376      Project of a point orthogonally onto a line
4377
4378      Computes the (orthogonal) projection of point PT1 onto the line
4379      LINE.
4380
4381      Function works also for multiple points and lines. In this case, it
4382       returns multiple points.    Point PT1 is a [N*2] array, and LINE
4383      is a [N*4] array (see createLine   for details). Result POINT is a
4384      [N*2] array, containing coordinates of   orthogonal projections of
4385      PT1 onto lines LINE.
4386
4387      See also: lines2d, points2d, isPointOnLine, linePosition
4388
4389
4390
4391
4392
4393 # name: <cell-element>
4394 # type: sq_string
4395 # elements: 1
4396 # length: 44
4397 Project of a point orthogonally onto a line
4398
4399
4400
4401
4402 # name: <cell-element>
4403 # type: sq_string
4404 # elements: 1
4405 # length: 7
4406 rad2deg
4407
4408
4409 # name: <cell-element>
4410 # type: sq_string
4411 # elements: 1
4412 # length: 284
4413  -- Function File: DEG = rad2deg(RAD)
4414      Convert angle from radians to degrees
4415
4416      Usage:   R = rad2deg(D)   convert an angle in radians to angle in
4417      degrees
4418
4419      Example:   rad2deg(pi)   ans =       180   rad2deg(pi/3)   ans =
4420         60
4421
4422      See also: angles2d, deg2rad
4423
4424
4425
4426
4427
4428 # name: <cell-element>
4429 # type: sq_string
4430 # elements: 1
4431 # length: 38
4432 Convert angle from radians to degrees
4433
4434
4435
4436
4437 # name: <cell-element>
4438 # type: sq_string
4439 # elements: 1
4440 # length: 11
4441 radicalAxis
4442
4443
4444 # name: <cell-element>
4445 # type: sq_string
4446 # elements: 1
4447 # length: 522
4448  -- Function File: LINE =  radicalAxis (CIRCLE1, CIRCLE2)
4449      Compute the radical axis (or radical line) of 2 circles
4450
4451      L = radicalAxis(C1, C2)   Computes the radical axis of 2 circles.
4452
4453      Example   C1 = [10 10 5];   C2 = [60 50 30];   L = radicalAxis(C1,
4454      C2);   hold on; axis equal;axis([0 100 0 100]);
4455      drawCircle(C1);drawCircle(C2);drawLine(L);
4456
4457      Ref:   http://mathworld.wolfram.com/RadicalLine.html
4458      http://en.wikipedia.org/wiki/Radical_axis
4459
4460      See also: lines2d, circles2d, createCircle
4461
4462
4463
4464
4465
4466 # name: <cell-element>
4467 # type: sq_string
4468 # elements: 1
4469 # length: 56
4470 Compute the radical axis (or radical line) of 2 circles
4471
4472
4473
4474
4475 # name: <cell-element>
4476 # type: sq_string
4477 # elements: 1
4478 # length: 16
4479 randomPointInBox
4480
4481
4482 # name: <cell-element>
4483 # type: sq_string
4484 # elements: 1
4485 # length: 658
4486  -- Function File: POINTS = randomPointInBox (BOX)
4487  -- Function File: POINTS = randomPointInBox (BOX, N)
4488      Generate random points within a box.
4489
4490      Generate a random point within the box BOX. The result is a 1-by-2
4491      row vector. If N is given, generates N points. The result is a
4492      N-by-2 array.
4493
4494      Example
4495
4496               % draw points within a box
4497               box = [10 80 20 60];
4498               pts =  randomPointInBox(box, 500);
4499               figure(1); clf; hold on;
4500               drawBox(box);
4501               drawPoint(pts, '.');
4502               axis('equal');
4503               axis([0 100 0 100]);
4504
4505      See also: edges2d, boxes2d, clipLine
4506
4507
4508
4509
4510
4511 # name: <cell-element>
4512 # type: sq_string
4513 # elements: 1
4514 # length: 36
4515 Generate random points within a box.
4516
4517
4518
4519 # name: <cell-element>
4520 # type: sq_string
4521 # elements: 1
4522 # length: 6
4523 rays2d
4524
4525
4526 # name: <cell-element>
4527 # type: sq_string
4528 # elements: 1
4529 # length: 722
4530  -- Function File: rays2d ()
4531      Description of functions operating on planar rays
4532
4533      A ray is defined by a point (its origin), and a vector (its
4534      direction). The different parameters are bundled into a row vector:
4535       `RAY = [x0 y0 dx dy];'
4536
4537      The ray contains all the points (x,y) such that:   x = x0 + t*dx
4538      y = y0 + t*dy;   for all t>0
4539
4540      Contrary to a (straight) line, the points located before the
4541      origin do   not belong to the ray.    However, as rays and lines
4542      have the same representation, some functions   working on lines
4543      are also working on rays (like `transformLine').
4544
4545      See also: points2d, vectors2d, lines2d, createRay, bisector,
4546      isPointOnRay, clipRay, drawRay
4547
4548
4549
4550
4551
4552 # name: <cell-element>
4553 # type: sq_string
4554 # elements: 1
4555 # length: 50
4556 Description of functions operating on planar rays
4557
4558
4559
4560
4561 # name: <cell-element>
4562 # type: sq_string
4563 # elements: 1
4564 # length: 11
4565 reverseEdge
4566
4567
4568 # name: <cell-element>
4569 # type: sq_string
4570 # elements: 1
4571 # length: 312
4572  -- Function File: RES =  reverseEdge (EDGE)
4573      Intervert the source and target vertices of edge
4574
4575      REV = reverseEdge(EDGE);   Returns the opposite edge of EDGE.
4576      EDGE has the format [X1 Y1 X2 Y2]. The resulting edge REV has value
4577       [X2 Y2 X1 Y1];
4578
4579      See also: edges2d, createEdge, reverseLine
4580
4581
4582
4583
4584
4585 # name: <cell-element>
4586 # type: sq_string
4587 # elements: 1
4588 # length: 49
4589 Intervert the source and target vertices of edge
4590
4591
4592
4593
4594 # name: <cell-element>
4595 # type: sq_string
4596 # elements: 1
4597 # length: 11
4598 reverseLine
4599
4600
4601 # name: <cell-element>
4602 # type: sq_string
4603 # elements: 1
4604 # length: 318
4605  -- Function File: LINE =  reverseLine (LINE)
4606      Return same line but with opposite orientation
4607
4608      INVLINE = reverseLine(LINE);   Returns the opposite line of LINE.
4609       LINE has the format [x0 y0 dx dy], then INVLINE will have
4610      following   parameters: [x0 y0 -dx -dy].
4611
4612      See also: lines2d, createLine
4613
4614
4615
4616
4617
4618 # name: <cell-element>
4619 # type: sq_string
4620 # elements: 1
4621 # length: 47
4622 Return same line but with opposite orientation
4623
4624
4625
4626
4627 # name: <cell-element>
4628 # type: sq_string
4629 # elements: 1
4630 # length: 12
4631 rotateVector
4632
4633
4634 # name: <cell-element>
4635 # type: sq_string
4636 # elements: 1
4637 # length: 304
4638  -- Function File: VR =  rotateVector (V, THETA)
4639      Rotate a vector by a given angle
4640
4641      Rotate the vector V by an angle THETA, given in radians.
4642
4643      Example
4644
4645             rotateVector([1 0], pi/2)
4646             ans =
4647                 0   1
4648
4649      See also: vectors2d, transformVector, createRotation
4650
4651
4652
4653
4654
4655 # name: <cell-element>
4656 # type: sq_string
4657 # elements: 1
4658 # length: 33
4659 Rotate a vector by a given angle
4660
4661
4662
4663
4664 # name: <cell-element>
4665 # type: sq_string
4666 # elements: 1
4667 # length: 10
4668 squareGrid
4669
4670
4671 # name: <cell-element>
4672 # type: sq_string
4673 # elements: 1
4674 # length: 494
4675  -- Function File: PTS =  squaregrid (BOUNDS, ORIGIN, SIZE)
4676      Generate equally spaces points in plane.
4677
4678      usage   PTS = squareGrid(BOUNDS, ORIGIN, SIZE)   generate points,
4679      lying in the window defined by BOUNDS (=[xmin ymin   xmax ymax]),
4680      starting from origin with a constant step equal to size.
4681
4682      Example   PTS = squareGrid([0 0 10 10], [3 3], [4 2])   will
4683      return points :   [3 1;7 1;3 3;7 3;3 5;7 5;3 7;7 7;3 9;7 9];
4684
4685      TODO: add possibility to use rotated grid
4686
4687
4688
4689
4690
4691 # name: <cell-element>
4692 # type: sq_string
4693 # elements: 1
4694 # length: 40
4695 Generate equally spaces points in plane.
4696
4697
4698
4699 # name: <cell-element>
4700 # type: sq_string
4701 # elements: 1
4702 # length: 13
4703 transformEdge
4704
4705
4706 # name: <cell-element>
4707 # type: sq_string
4708 # elements: 1
4709 # length: 587
4710  -- Function File: EDGE2 =  transformEdge (EDGE1, T)
4711      Transform an edge with an affine transform.
4712
4713      Where EDGE1 has the form [x1 y1 x2 y1], and T is a transformation
4714      matrix, return the edge transformed with affine transform T.
4715
4716      Format of TRANS can be one of :   [a b]   ,   [a b c] , or [a b c]
4717       [d e]       [d e f]      [d e f]                            [0 0
4718      1]
4719
4720      Also works when EDGE1 is a [Nx4] array of double. In this case,
4721      EDGE2   has the same size as EDGE1.
4722
4723      See also: edges2d, transforms2d, transformPoint, translation,
4724      rotation
4725
4726
4727
4728
4729
4730 # name: <cell-element>
4731 # type: sq_string
4732 # elements: 1
4733 # length: 43
4734 Transform an edge with an affine transform.
4735
4736
4737
4738 # name: <cell-element>
4739 # type: sq_string
4740 # elements: 1
4741 # length: 13
4742 transformLine
4743
4744
4745 # name: <cell-element>
4746 # type: sq_string
4747 # elements: 1
4748 # length: 554
4749  -- Function File: LINE2 =  transformLine (LINE1, T)
4750      Transform a line with an affine transform.
4751
4752      Returns the line LINE1 transformed with affine transform T.
4753      LINE1 has the form [x0 y0 dx dy], and T is a transformation
4754      matrix.
4755
4756      Format of T can be one of :   [a b]   ,   [a b c] , or [a b c]
4757      [d e]       [d e f]      [d e f]                            [0 0 1]
4758
4759      Also works when LINE1 is a [Nx4] array of double. In this case,
4760      LINE2   has the same size as LINE1.
4761
4762      See also: lines2d, transforms2d, transformPoint
4763
4764
4765
4766
4767
4768 # name: <cell-element>
4769 # type: sq_string
4770 # elements: 1
4771 # length: 42
4772 Transform a line with an affine transform.
4773
4774
4775
4776 # name: <cell-element>
4777 # type: sq_string
4778 # elements: 1
4779 # length: 14
4780 transformPoint
4781
4782
4783 # name: <cell-element>
4784 # type: sq_string
4785 # elements: 1
4786 # length: 849
4787  -- Function File: PT2 =  transformPoint (PT1, TRANS)
4788  -- Function File: [PX2 PY2]=  transformPoint (PX1, PY1, TRANS)
4789      Transform a point with an affine transform.
4790
4791      where PT1 has the form [xp yp], and TRANS is a [2x2], [2x3] or
4792      [3x3]   matrix, returns the point transformed with affine
4793      transform TRANS.
4794
4795      Format of TRANS can be one of :   [a b]   ,   [a b c] , or [a b c]
4796       [d e]       [d e f]      [d e f]                            [0 0
4797      1]
4798
4799      Also works when PT1 is a [Nx2] array of double. In this case, PT2
4800      has   the same size as PT1.
4801
4802      Also works when PX1 and PY1 are arrays the same size. The function
4803       transform each couple of (PX1, PY1), and return the result in
4804      (PX2, PY2), which is the same size as (PX1 PY1).
4805
4806      See also: points2d, transforms2d, createTranslation, createRotation
4807
4808
4809
4810
4811
4812 # name: <cell-element>
4813 # type: sq_string
4814 # elements: 1
4815 # length: 43
4816 Transform a point with an affine transform.
4817
4818
4819
4820 # name: <cell-element>
4821 # type: sq_string
4822 # elements: 1
4823 # length: 15
4824 transformVector
4825
4826
4827 # name: <cell-element>
4828 # type: sq_string
4829 # elements: 1
4830 # length: 786
4831  -- Function File: V2 =  transformVector (V, T)
4832  -- Function File: [X2 Y2] =  transformVector (X,Y, T)
4833      Transform a vector with an affine transform
4834
4835      V has the form [xv yv], and T is a [2x2], [2x3] or [3x3]   matrix,
4836      returns the vector transformed with affine transform T.
4837
4838      Format of T can be one of :
4839      [a b]   ,   [a b c] , or [a b c]   [d e]       [d e f]      [d e f]
4840                                [0 0 1]
4841
4842      Also works when V is a [Nx2] array of double. In this case, V2 has
4843       the same size as V.
4844
4845      Also works when X and Y are arrays the same size. The function
4846      transform each couple of (X, Y), and return the result in   (X2,
4847      Y2), which is the same size as (X, Y).
4848
4849      See also: vectors2d, transforms2d, rotateVector, transformPoint
4850
4851
4852
4853
4854
4855 # name: <cell-element>
4856 # type: sq_string
4857 # elements: 1
4858 # length: 44
4859 Transform a vector with an affine transform
4860
4861
4862
4863
4864 # name: <cell-element>
4865 # type: sq_string
4866 # elements: 1
4867 # length: 12
4868 transforms2d
4869
4870
4871 # name: <cell-element>
4872 # type: sq_string
4873 # elements: 1
4874 # length: 675
4875  -- Function File: transforms2d ()
4876      Description of functions operating on transforms
4877
4878      By 'transform' we mean an affine transform. A planar affine
4879      transform   can be represented by a 3x3 matrix.
4880
4881      Example
4882
4883             % create a translation by the vector [10 20]:
4884             T = createTranslation([10 20])
4885             T =
4886                  1     0    10
4887                  0     1    20
4888                  0     0     1
4889
4890      See also: createTranslation, createRotation, createScaling,
4891      createBasisTransform, createHomothecy, createLineReflection,
4892      fitAffineTransform2d, transformPoint, transformVector,
4893      transformLine, transformEdge, rotateVector
4894
4895
4896
4897
4898
4899 # name: <cell-element>
4900 # type: sq_string
4901 # elements: 1
4902 # length: 49
4903 Description of functions operating on transforms
4904
4905
4906
4907
4908 # name: <cell-element>
4909 # type: sq_string
4910 # elements: 1
4911 # length: 12
4912 triangleGrid
4913
4914
4915 # name: <cell-element>
4916 # type: sq_string
4917 # elements: 1
4918 # length: 477
4919  -- Function File: PTS =  triangleGrid (BOUNDS, ORIGIN, SIZE)
4920      Generate triangular grid of points in the plane.
4921
4922      usage   PTS = triangleGrid(BOUNDS, ORIGIN, SIZE)   generate
4923      points, lying in the window defined by BOUNDS, given in form
4924      [xmin ymin xmax ymax], starting from origin with a constant step
4925      equal   to size.    SIZE is constant and is equals to the length
4926      of the sides of each   triangles.
4927
4928      TODO: add possibility to use rotated grid
4929
4930
4931
4932
4933
4934 # name: <cell-element>
4935 # type: sq_string
4936 # elements: 1
4937 # length: 48
4938 Generate triangular grid of points in the plane.
4939
4940
4941
4942 # name: <cell-element>
4943 # type: sq_string
4944 # elements: 1
4945 # length: 11
4946 vectorAngle
4947
4948
4949 # name: <cell-element>
4950 # type: sq_string
4951 # elements: 1
4952 # length: 932
4953  -- Function File: ALPHA = vectorAngle (V1)
4954      Angle of a vector, or between 2 vectors
4955
4956      A = vectorAngle(V);   Returns angle between Ox axis and vector
4957      direction, in Counter   clockwise orientation.    The result is
4958      normalised between 0 and 2*PI.
4959
4960      A = vectorAngle(V1, V2);   Returns the angle from vector V1 to
4961      vector V2, in counter-clockwise   order, and in radians.
4962
4963      A = vectorAngle(..., 'cutAngle', CUTANGLE);   A = vectorAngle(...,
4964      CUTANGLE); % (deprecated syntax)   Specifies convention for angle
4965      interval. CUTANGLE is the center of the   2*PI interval containing
4966      the result. See <a href="matlab:doc
4967      ('normalizeAngle')">normalizeAngle</a> for details.
4968
4969      Example:   rad2deg(vectorAngle([2 2]))   ans =       45
4970      rad2deg(vectorAngle([1 sqrt(3)]))   ans =       60
4971      rad2deg(vectorAngle([0 -1]))   ans =       270
4972
4973      See also: vectors2d, angles2d, normalizeAngle
4974
4975
4976
4977
4978
4979 # name: <cell-element>
4980 # type: sq_string
4981 # elements: 1
4982 # length: 40
4983 Angle of a vector, or between 2 vectors
4984
4985
4986
4987
4988 # name: <cell-element>
4989 # type: sq_string
4990 # elements: 1
4991 # length: 10
4992 vectorNorm
4993
4994
4995 # name: <cell-element>
4996 # type: sq_string
4997 # elements: 1
4998 # length: 751
4999  -- Function File: NM =  vectorNorm (V)
5000  -- Function File: NM =  vectorNorm (V,N)
5001      Compute norm of a vector, or of a set of vectors
5002
5003      Without extra arguments, returns the euclidean norm of vector V.
5004      Optional argument N specifies the norm to use. N can be any value
5005      greater than 0.
5006     `N=1'
5007           City lock norm.
5008
5009     `N=2'
5010           Euclidean norm.
5011
5012     `N=inf'
5013           Compute max coord.
5014
5015      When V is a MxN array, compute norm for each vector of the array.
5016       Vector are given as rows. Result is then a Mx1 array.
5017
5018      Example
5019
5020             n1 = vectorNorm([3 4])
5021             n1 =
5022                 5
5023
5024             n2 = vectorNorm([1, 10], inf)
5025             n2 =
5026                 10
5027
5028      See also: vectors2d, vectorAngle
5029
5030
5031
5032
5033
5034 # name: <cell-element>
5035 # type: sq_string
5036 # elements: 1
5037 # length: 49
5038 Compute norm of a vector, or of a set of vectors
5039
5040
5041
5042
5043 # name: <cell-element>
5044 # type: sq_string
5045 # elements: 1
5046 # length: 9
5047 vectors2d
5048
5049
5050 # name: <cell-element>
5051 # type: sq_string
5052 # elements: 1
5053 # length: 502
5054  -- Function File: vectors2d ()
5055      Description of functions operating on plane vectors
5056
5057      A vector is defined by its two cartesian coordinates, put into a
5058      row   vector of 2 elements:   `V = [vx vy];'
5059
5060      Several vectors are stored in a matrix with two columns, one for
5061      the   x-coordinate, one for the y-coordinate.    `VS = [vx1 vy1 ;
5062      vx2 vy2 ; vx3 vy3];'
5063
5064      See also: vectorNorm, vectorAngle, isPerpendicular, isParallel,
5065      normalizeVector, transformVector, rotateVector
5066
5067
5068
5069
5070
5071 # name: <cell-element>
5072 # type: sq_string
5073 # elements: 1
5074 # length: 52
5075 Description of functions operating on plane vectors
5076
5077
5078
5079
5080
5081