ГОС! Р ИСО 10303-203-2003
v2: LIST |3:3| OF REAL:
vI: LIST (3:31 OF REAL;
mag: REAL:
res: direction:
result: vector.
END_LOCAL ;
IF (NOT EXISTS (argl)) OR (atgl.dim = 2) OR (NOT EXISTS <aig2)) OR (aig2
.dim - 2) THEN RETURN (?) ;
ELSE
BEGIN
vl :■*normalisc(argl).dircction_ratios;
v2 :** normalisc(arg2).dircction_rdtios:
res :•=»dummv_gri | | direction <((vl{2| * v2|3|) - (vl|3) * v2|2|). (
v 1(3] » v2|l|) - (vMU * v2|3)), (villi * v2|2|) - (vl|2] * v2|I|)|);
mag : = 0 ;
REPEAT i : - I TO 3 BY 1;
mag :■=mag + (rcs.directk>n_rulios|i| * rcs.dircction_ratios |i|);
END_REPEAT ;
IF mag >0 THEN
result := dummy_gri 11\ectortres. SQRT(mag));
ELSE
result := dummy_gri 11vcctorlargl. 0);
ENDJF ;
RETURN (result) :
END;
EN DJF:
END.FUNCTION; - - cross_product
FUNCTION curve_wcights_poedtive(b: rational_b_splinc_curve): BOOLEAN;
LOCAL
result : BOOLEANTRUE;
END_LOC’AL ;
REPLAT i := 0 TO b.uppcr_index_on_control_points BY I;
IF b.weights |i| <=» 0 THEN resultFALSE;
RETURN (result) ;
EN D JF;
END_REPEAT;
RETURN (result);
END_FUNCTION; - - curvc_wcights_positivc
FUNCTION derive_dimensional_exponents(x: unit): dimensional exponents;
LOCAL
i: INTEGER;
result: dimcnsional_cxponcnts :■=dimcnsional_cxponents(0, 0. 0. 0. 0. 0. 0);
END.LOCAL ;
IF CONFlG_CONTROL_DESIGN.DERIVED_UNir IN TYPEOF(x) THEN
REPEAT i LOI NDEX (x.clcments) TO HIlNDEX(x.dements) BY I;
result.Icngth.exponcnt := rcsull.lenglh.cxponent +
(x.clcments fi].
exponent * x.clcmentsli|.unit.dimensions.!ength_exponent);
result.mass exponent := result.massexponent
4
(x.clcmcnts|i|.
exponent • x.elemenis|i|.unil.dimcnsions.mass_exponcnl);
result.time.cxponcnl:« rcsult.time.cxponcnt
4
(x.elcmcntsli|.
exponent * x.cIcmcnts|i|.unit.dimensions.timc_cxponent);
rcsult.clcctric.currcnt.exponenl := result.
clcaric_currcnt_exponcnt
4
(x.ekmcnts |i).exponcnl * x.
elcments|i|.unit.dimensions.clcctric_current_cxponent);
result.tbcrmodynamic_tempcraturc_cxponcnt :=■result.
thermodynamic_tempcrature_cxponcnt + (x.clcmentsli|.cxponent *
x.elcmcnts|i|.unit. dimensions.
188