Compute normal by means of vertices data.
type(facet_object) :: facet facet%vertex_1 = -0.231369_R4P * ex_R4P + 0.0226865_R4P * ey_R4P + 1._R4P * ez_R4P facet%vertex_2 = -0.227740_R4P * ex_R4P + 0.0245457_R4P * ey_R4P + 0._R4P * ez_R4P facet%vertex_2 = -0.235254_R4P * ex_R4P + 0.0201881_R4P * ey_R4P + 0._R4P * ez_R4P call facet%sanitize_normal print "(3(F3.1,1X))", facet%normal%x, facet%normal%y, facet%normal%z
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(facet_object), | intent(inout) | :: | self | Facet. |
elemental subroutine compute_normal(self)
!< Compute normal by means of vertices data.
!<
!<```fortran
!< type(facet_object) :: facet
!< facet%vertex_1 = -0.231369_R4P * ex_R4P + 0.0226865_R4P * ey_R4P + 1._R4P * ez_R4P
!< facet%vertex_2 = -0.227740_R4P * ex_R4P + 0.0245457_R4P * ey_R4P + 0._R4P * ez_R4P
!< facet%vertex_2 = -0.235254_R4P * ex_R4P + 0.0201881_R4P * ey_R4P + 0._R4P * ez_R4P
!< call facet%sanitize_normal
!< print "(3(F3.1,1X))", facet%normal%x, facet%normal%y, facet%normal%z
!<```
!=> -0.501673222 0.865057290 -2.12257713<<<
class(facet_object), intent(inout) :: self !< Facet.
self%normal = face_normal3_R8P(pt1=self%vertex_1, pt2=self%vertex_2, pt3=self%vertex_3, norm='y')
endsubroutine compute_normal