Day 45 complete

This commit is contained in:
2023-12-29 14:53:00 -05:00
parent 577ee6b208
commit 470e85ea3a
7 changed files with 188 additions and 96 deletions

View File

@ -46,7 +46,7 @@ constexpr char const* vec2f_ops = stringize(
<unit_type> result = sqrt( v.x * v.x + v.y * v.y );
return result;
}
inline
<type> normalize( <type> v ) {
<unit_type> square_size = v.x * v.x + v.y * v.y;
@ -63,11 +63,16 @@ constexpr char const* vec2f_ops = stringize(
}
inline
<unit_type> scalar_product( <type> a, <type> b )
{
<unit_type> scalar_product( <type> a, <type> b ) {
<unit_type> result = a.x * b.x + a.y * b.y;
return result;
}
inline
<unit_type> magnitude_squared( <type> v ) {
<unit_type> result = scalar_product( v, v );
return result;
}
inline
<type> operator - ( <type> v ) {