| @@ -17,6 +17,7 @@ | |||||
| {$ENDIF} | {$ENDIF} | ||||
| function ToString(const aRound: Integer = -3): String; inline; | function ToString(const aRound: Integer = -3): String; inline; | ||||
| class function FromString(const s: String): __VEC; static; inline; | class function FromString(const s: String): __VEC; static; inline; | ||||
| class function TryFromString(const s: String; out v: __VEC): Boolean; static; inline; | class function TryFromString(const s: String; out v: __VEC): Boolean; static; inline; | ||||
| class function Zero: __VEC; static; inline; | class function Zero: __VEC; static; inline; | ||||
| @@ -424,6 +425,7 @@ | |||||
| type __HELPER_I = type helper(__HELPER) for __VEC | type __HELPER_I = type helper(__HELPER) for __VEC | ||||
| public | public | ||||
| function Length: Double; inline; | function Length: Double; inline; | ||||
| function Abs: __VEC; | |||||
| {$IF __SIZE <> 4} | {$IF __SIZE <> 4} | ||||
| function Add(const v: __VEC): __VEC; inline; | function Add(const v: __VEC): __VEC; inline; | ||||
| function Subtract(const v: __VEC): __VEC; inline; | function Subtract(const v: __VEC): __VEC; inline; | ||||
| @@ -915,6 +917,13 @@ | |||||
| result := __IMPL.Length(self); | result := __IMPL.Length(self); | ||||
| end; | end; | ||||
| function __HELPER_I.Abs: __VEC; | |||||
| var i: Integer; | |||||
| begin | |||||
| for i := Low(self) to High(self) do | |||||
| result[i] := System.abs(self[i]); | |||||
| end; | |||||
| {$IF __SIZE <> 4} | {$IF __SIZE <> 4} | ||||
| function __HELPER_I.Add(const v: __VEC): __VEC; | function __HELPER_I.Add(const v: __VEC): __VEC; | ||||
| begin | begin | ||||