Evaluation function for Bend modifier.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(bend), | intent(in) | :: | this | |||
type(vector), | intent(in) | :: | pos |
Position to evaluate the modifier at |
pure elemental function eval_bend(this, pos) result(res) !! Evaluation function for Bend modifier. class(bend), intent(in) :: this !> Position to evaluate the modifier at type(vector), intent(IN) :: pos real(kind=wp) :: res real(kind=wp) :: c, s, x2, y2, z2 c = cos(this%k * pos%x) s = sin(this%k * pos%x) x2 = c * pos%x - s * pos%y y2 = s * pos%x + c * pos%y z2 = pos%z res = this%prim%evaluate(vector(x2, y2, z2)) end function eval_bend