185 std::cout << __func__ << std::endl;
187 float sqrt2_over_2 = std::numbers::sqrt2_v<float> / 2.0f;
191 CHECK_IF_ZERO( dot(Vector2Df::unit_x(), Vector2Df::unit_y()) );
194 CHECK_IF_EQUAL( dot(Vector2Df::unit_x(), Vector2Df::unit_x()), 1.0f);
195 CHECK_IF_EQUAL( dot(Vector2Df::unit_y(), Vector2Df::unit_y()), 1.0f);
198 CHECK_IF_EQUAL( dot(Vector2Df{sqrt2_over_2, sqrt2_over_2}, Vector2Df{sqrt2_over_2, sqrt2_over_2}), 1.0f );
203 std::cout << __func__ << std::endl;
207 Vector2Df left{ 1.0f, 2.0f };
208 Vector2Df right{ 1.0f, 2.0f };
209 Vector2Df result = left + right;
217 Vector2Df left{ 1.0f, 2.0f };
218 Vector2Df right{ 3.0f, 4.0f };
219 Vector2Df result = left + right.yx();
227 Vector2Df left{ 1.0f, 2.0f };
228 Vector2Df right{ 3.0f, 4.0f };
229 Vector2Df result = left.xy() + right.xy();
231 CHECK_IF_EQUAL( left.xy() + right.xy(), Vector2Df( 4.0f, 6.0f ) );
238 std::cout << __func__ << std::endl;
242 Vector2Df left{ 1.0f, 2.0f };
243 Vector2Df right{ 1.0f, 2.0f };
244 Vector2Df result = left - right;
252 Vector2Df left{ 1.0f, 2.0f };
253 Vector2Df right{ 1.0f, 2.0f };
254 Vector2Df result = left - right.yx();
262 Vector2Df left{ 5.0f, 9.0f };
263 Vector2Df right{ 3.0f, 7.0f };
264 Vector2Df result = left - right.yx();
273 std::cout << __func__ << std::endl;
277 Vector2Df left{ 3.0f, 4.0f };
278 Vector2Df right{ 5.0f, 9.0f };
279 Vector2Df result = left * right;
288 Vector2Df left{ 3.0f, 4.0f };
290 Vector2Df result = left * scalar;
291 Vector2Df result2 = scalar * left;
301 Vector2Df left{ 3.0f, 4.0f };
302 Vector2Df right{ 5.0f, 9.0f };
303 Vector2Df result = left * right.xy();
304 Vector2Df result2 = right.xy() * left;
314 Vector2Df left{ 1.0f, 3.0f };
315 Vector2Df right{ 2.0f, 6.0f };
316 Vector2Df result = left.xy() * right.xy();
317 Vector2Df result2 = right.xy() * left.xy();
319 CHECK_IF_EQUAL( left.xy() * right.xy(), Vector2Df{ 2.0f, 18.0f} );
320 CHECK_IF_EQUAL( right.xy() * left.xy(), Vector2Df{ 2.0f, 18.0f} );
327 Vector2Df left{ 3.0f, 4.0f };
329 Vector2Df result = left.xy() * scalar;
330 Vector2Df result2 = scalar * left.xy();