@@ 131-142 (lines=12) @@ | ||
128 | * |
|
129 | * @return float |
|
130 | */ |
|
131 | public function absMin() : float |
|
132 | { |
|
133 | $result = 0.0; |
|
134 | ||
135 | foreach ($this->components as $component) { |
|
136 | if ($result > $abs = abs($component)) { |
|
137 | $result = $abs; |
|
138 | } |
|
139 | } |
|
140 | ||
141 | return $result; |
|
142 | } |
|
143 | ||
144 | /** |
|
145 | * Returns the biggest of the components compared as absolute values. This is *not* the |
|
@@ 150-161 (lines=12) @@ | ||
147 | * |
|
148 | * @return float |
|
149 | */ |
|
150 | public function absMax() : float |
|
151 | { |
|
152 | $result = 0.0; |
|
153 | ||
154 | foreach ($this->components as $component) { |
|
155 | if ($result < $abs = abs($component)) { |
|
156 | $result = $abs; |
|
157 | } |
|
158 | } |
|
159 | ||
160 | return $result; |
|
161 | } |
|
162 | ||
163 | /** |
|
164 | * Adds $that Vector/number to this Vector and returns the result as a new Vector. |