7fd59977 |
1 | -- File: Geom2d_Vector.cdl |
2 | -- Created: Wed Mar 24 18:26:25 1993 |
3 | -- Author: JCV |
4 | -- <fid@sdsun2> |
5 | -- Copyright: Matra Datavision 1993 |
6 | |
7 | ---Copyright: Matra Datavision 1991 |
8 | |
9 | |
10 | deferred class Vector from Geom2d inherits Geometry from Geom2d |
11 | |
12 | --- Purpose : The abstract class Vector describes the common |
13 | -- behavior of vectors in 2D space. |
14 | -- The Geom2d package provides two concrete |
15 | -- classes of vectors: Geom2d_Direction (unit vector) |
16 | -- and Geom2d_VectorWithMagnitude. |
17 | |
18 | uses Ax2d from gp, |
19 | Pnt2d from gp, |
20 | Vec2d from gp |
21 | |
22 | raises DomainError from Standard, |
23 | VectorWithNullMagnitude from gp |
24 | |
25 | is |
26 | |
27 | |
28 | Reverse (me : mutable); |
29 | --- Purpose : Reverses the vector <me>. |
30 | |
31 | |
32 | Reversed (me) returns mutable like me |
33 | --- Purpose : Returns a copy of <me> reversed. |
34 | is static; |
35 | |
36 | |
37 | Angle (me; Other : Vector) returns Real |
38 | --- Purpose : Computes the angular value, in radians, between this |
39 | -- vector and vector Other. The result is a value |
40 | -- between -Pi and Pi. The orientation is from this |
41 | -- vector to vector Other. |
42 | -- Raises VectorWithNullMagnitude if one of the two vectors is a vector with |
43 | -- null magnitude because the angular value is indefinite. |
44 | raises VectorWithNullMagnitude; |
45 | |
46 | Coord (me; X, Y : out Real); |
47 | --- Purpose : Returns the coordinates of <me>. |
48 | |
49 | |
50 | Magnitude (me) returns Real |
51 | --- Purpose : Returns the Magnitude of <me>. |
52 | is deferred; |
53 | |
54 | |
55 | SquareMagnitude (me) returns Real |
56 | --- Purpose : Returns the square magnitude of <me>. |
57 | is deferred; |
58 | |
59 | |
60 | X (me) returns Real; |
61 | --- Purpose : Returns the X coordinate of <me>. |
62 | |
63 | |
64 | Y (me) returns Real; |
65 | --- Purpose : Returns the Y coordinate of <me>. |
66 | |
67 | |
68 | Crossed (me; Other : Vector) returns Real |
69 | --- Purpose : Cross product of <me> with the vector <Other>. |
70 | is deferred; |
71 | |
72 | |
73 | Dot (me; Other : Vector) returns Real; |
74 | --- Purpose : Returns the scalar product of 2 Vectors. |
75 | |
76 | |
77 | Vec2d (me) returns Vec2d; |
78 | --- Purpose : Returns a non persistent copy of <me>. |
79 | |
80 | |
81 | |
82 | fields |
83 | |
84 | gpVec2d : Vec2d is protected; |
85 | |
86 | end; |