mirror of
https://github.com/Ed94/HandmadeHero.git
synced 2025-07-01 11:21:05 -07:00
Day 45 complete
This commit is contained in:
@ -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 ) {
|
||||
|
Reference in New Issue
Block a user