18template<
typename Value>
27 Value
evaluate(Value x, Value y)
const override;
33template<
typename Value>
40template<
typename Value>
47template<
typename Value>
52template<
typename Value>
55 const Value projectedSignedLengthOnNormal = m_unitNormal.dot({x, y});
56 return projectedSignedLengthOnNormal > 0
58 : (projectedSignedLengthOnNormal < 0 ? 0 : static_cast<Value>(0.5));
A step function in 2-D, with a specific normal direction. This is a simplified version of general Hea...
Definition THeavisideStep2D.h:20
static auto makeVertical() -> THeavisideStep2D
Definition THeavisideStep2D.h:41
Value evaluate(Value x, Value y) const override
Definition THeavisideStep2D.h:53
static auto makeHorizontal() -> THeavisideStep2D
Definition THeavisideStep2D.h:34
THeavisideStep2D(TVector2< Value > normal)
Definition THeavisideStep2D.h:48
Definition TMathFunction2D.h:8
Represents a 2-D vector.
Definition TVector2.h:19
Math functions and utilities.
Definition TransformInfo.h:10
void normalize(std::array< T, N > &vec)
Treating input values as a vector and normalize it. Notice that normalizing a integer typed vector wi...
Definition math.ipp:142