1 -- Created on: 1993-03-24
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class Parabola from Geom2d inherits Conic from Geom2d
20 --- Purpose : Describes a parabola in the plane (2D space).
21 -- A parabola is defined by its focal length (i.e. the
22 -- distance between its focus and its apex) and is
23 -- positioned in the plane with a coordinate system
24 -- (gp_Ax22d object) where:
25 -- - the origin is the apex of the parabola, and
26 -- - the "X Axis" defines the axis of symmetry; the
27 -- parabola is on the positive side of this axis.
28 -- This coordinate system is the local coordinate
29 -- system of the parabola.
30 -- The orientation (direct or indirect) of the local
31 -- coordinate system gives an explicit orientation to the
32 -- parabola, determining the direction in which the
33 -- parameter increases along the parabola.
34 -- The Geom_Parabola parabola is parameterized as follows:
35 -- P(U) = O + U*U/(4.*F)*XDir + U*YDir, where:
36 -- - P is the point of parameter U,
37 -- - O, XDir and YDir are respectively the origin, "X
38 -- Direction" and "Y Direction" of its local coordinate system,
39 -- - F is the focal length of the parabola.
40 -- The parameter of the parabola is therefore its Y
41 -- coordinate in the local coordinate system, with the "X
42 -- Axis" of the local coordinate system defining the
43 -- origin of the parameter.
44 -- The parameter range is ] -infinite,+infinite [.
54 raises ConstructionError from Standard,
55 RangeError from Standard
63 Create (Prb : Parab2d) returns Parabola;
64 --- Purpose : Creates a parabola from a non persistent one.
67 Create (MirrorAxis : Ax2d; Focal : Real;
68 Sense: Boolean from Standard = Standard_True)
71 -- Creates a parabola with its "MirrorAxis" and it's focal
73 -- MirrorAxis is the axis of symmetry of the curve, it is the
74 -- "XAxis". The "YAxis" is parallel to the directrix of the
75 -- parabola and is in the direct sense if Sense is True.
76 -- The "Location" point of "MirrorAxis" is the vertex of the parabola
77 raises ConstructionError;
78 --- Purpose : Raised if Focal < 0.0
80 Create (Axis : Ax22d; Focal : Real) returns Parabola
82 -- Creates a parabola with its Axis and it's focal
84 -- The XDirection of Axis is the axis of symmetry of the curve,
85 -- it is the "XAxis". The "YAxis" is parallel to the directrix of the
86 -- parabola. The "Location" point of "Axis" is the vertex
88 raises ConstructionError;
89 --- Purpose : Raised if Focal < 0.0
92 Create (D : Ax2d; F : Pnt2d) returns Parabola;
94 -- D is the directrix of the parabola and F the focus point.
95 -- The symmetry axis "XAxis" of the parabola is normal to the
96 -- directrix and pass through the focus point F, but its
97 -- "Location" point is the vertex of the parabola.
98 -- The "YAxis" of the parabola is parallel to D and its "Location"
99 -- point is the vertex of the parabola.
102 SetFocal (me : mutable; Focal : Real)
103 --- Purpose : Assigns the value Focal to the focal length of this parabola.
104 -- Exceptions Standard_ConstructionError if Focal is negative.
105 raises ConstructionError;
108 SetParab2d (me : mutable; Prb : Parab2d);
109 --- Purpose: Converts the gp_Parab2d parabola Prb into this parabola.
111 Parab2d (me) returns Parab2d;
113 -- Returns the non persistent parabola from gp with the same
114 -- geometric properties as <me>.
117 ReversedParameter(me; U : Real) returns Real is redefined static;
118 ---Purpose: Computes the parameter on the reversed parabola
119 -- for the point of parameter U on this parabola.
120 -- For a parabola, the returned value is -U.
123 FirstParameter (me) returns Real is redefined static;
124 --- Purpose : Returns RealFirst from Standard.
127 LastParameter (me) returns Real is redefined static;
128 --- Purpose : Returns RealLast from Standard.
131 IsClosed (me) returns Boolean is redefined static;
132 --- Purpose : Returns False
135 IsPeriodic (me) returns Boolean is redefined static;
136 --- Purpose : Returns False
139 Directrix (me) returns Ax2d;
140 --- Purpose : The directrix is parallel to the "YAxis" of the parabola.
141 -- The "Location" point of the directrix is the intersection
142 -- point between the directrix and the symmetry axis ("XAxis") of the parabola.
145 Eccentricity (me) returns Real is redefined static;
146 --- Purpose : Returns the eccentricity e = 1.0
149 Focus (me) returns Pnt2d;
150 ---Purpose: Computes the focus of this parabola The focus is on the
151 -- positive side of the "X Axis" of the local coordinate system of the parabola.
153 Focal (me) returns Real;
154 --- Purpose : Computes the focal length of this parabola.
155 -- The focal length is the distance between the apex and the focus of the parabola.
159 Parameter (me) returns Real;
160 --- Purpose : Computes the parameter of this parabola, which is
161 -- the distance between its focus and its directrix. This
162 -- distance is twice the focal length.
163 -- If P is the parameter of the parabola, the equation of
164 -- the parabola in its local coordinate system is: Y**2 = 2.*P*X.
167 D0(me; U : Real; P : out Pnt2d) is redefined static;
168 ---Purpose: Returns in P the point of parameter U.
169 -- If U = 0 the returned point is the origin of the XAxis and
170 -- the YAxis of the parabola and it is the vertex of the parabola.
171 -- P = S + F * (U * U * XDir + * U * YDir)
172 -- where S is the vertex of the parabola, XDir the XDirection and
173 -- YDir the YDirection of the parabola's local coordinate system.
176 D1 (me; U : Real; P : out Pnt2d; V1 : out Vec2d) is redefined static;
178 -- Returns the point P of parameter U and the first derivative V1.
181 D2 (me; U : Real; P : out Pnt2d; V1, V2 : out Vec2d) is redefined static;
183 -- Returns the point P of parameter U, the first and second
184 -- derivatives V1 and V2.
187 D3 (me; U : Real; P : out Pnt2d; V1, V2, V3 : out Vec2d) is redefined static;
189 -- Returns the point P of parameter U, the first second and third
190 -- derivatives V1 V2 and V3.
193 DN (me; U : Real; N : Integer) returns Vec2d
194 --- Purpose : For the point of parameter U of this parabola,
195 -- computes the vector corresponding to the Nth derivative.
196 -- Exceptions Standard_RangeError if N is less than 1.
200 Transform (me : mutable; T : Trsf2d) is redefined static;
201 ---Purpose: Applies the transformation T to this parabola.
203 TransformedParameter(me; U : Real; T : Trsf2d from gp) returns Real
204 ---Purpose: Computes the parameter on the transformed
205 -- parabola, for the point of parameter U on this parabola.
206 -- For a parabola, the returned value is equal to U
207 -- multiplied by the scale factor of transformation T.
210 ParametricTransformation(me; T : Trsf2d from gp) returns Real
211 ---Purpose: Returns a coefficient to compute the parameter on
212 -- the transformed curve for the transform of the
215 -- Transformed(T)->Value(U * ParametricTransformation(T))
217 -- is the same point as
219 -- Value(U).Transformed(T)
221 -- This methods returns T.ScaleFactor()
225 Copy (me) returns like me
227 ---Purpose: Creates a new object, which is a copy of this parabola.