44 real(kind=
dp),
dimension(3) :: x
78 class(
point_t),
intent(inout) :: this
79 real(kind=
dp),
dimension(3),
intent(in) :: x
80 integer,
optional,
intent(in) :: id
94 class(
point_t),
intent(inout) :: this
95 real(kind=
dp),
intent(in) :: x
96 real(kind=
dp),
intent(in) :: y
97 real(kind=
dp),
intent(in) :: z
98 integer,
optional,
intent(in) :: id
100 if (
present(id))
then
114 class(
point_t),
intent(inout) :: this
115 real(kind=
dp),
dimension(3),
intent(in) :: x
124 class(
point_t),
intent(in) :: p1
125 class(
point_t),
intent(in) :: p2
128 if (
abscmp(p1%x(1), p2%x(1)) .and. &
129 abscmp(p1%x(2), p2%x(2)) .and. &
130 abscmp(p1%x(3), p2%x(3)))
then
141 class(
point_t),
intent(in) :: p1
142 class(
point_t),
intent(in) :: p2
145 if (.not.
abscmp(p1%x(1), p2%x(1)) .or. &
146 .not.
abscmp(p1%x(2), p2%x(2)) .or. &
147 .not.
abscmp(p1%x(3), p2%x(3)))
then
158 class(
point_t),
intent(in) :: p1
159 class(
point_t),
intent(in) :: p2
162 if (p1%x(1) .lt. p2%x(1) .or. &
163 (
abscmp(p1%x(1), p2%x(1)) .and. &
164 (p1%x(2) .lt. p2%x(2) .or. &
165 (
abscmp(p1%x(2), p2%x(2)) .and. p1%x(3) .lt. p2%x(3)))))
then
176 class(
point_t),
intent(in) :: p1
177 class(
point_t),
intent(in) :: p2
190 class(
point_t),
intent(in) :: p1
191 class(
point_t),
intent(in) :: p2
194 res%x(1) = p1%x(1) + p2%x(1)
195 res%x(2) = p1%x(2) + p2%x(2)
196 res%x(3) = p1%x(3) + p2%x(3)
202 class(
point_t),
intent(in) :: p1
203 class(
point_t),
intent(in) :: p2
206 res%x(1) = p1%x(1) - p2%x(1)
207 res%x(2) = p1%x(2) - p2%x(2)
208 res%x(3) = p1%x(3) - p2%x(3)
214 class(
point_t),
intent(in) :: p
215 real(kind=
rp),
intent(in) :: a
218 res%x(1) = a * p%x(1)
219 res%x(2) = a * p%x(2)
220 res%x(3) = a * p%x(3)
226 class(
point_t),
intent(in) :: p1
227 type(
point_t),
intent(in) :: p2
230 res = sqrt( (p1%x(1) - p2%x(1))**2 &
231 + (p1%x(2) - p2%x(2))**2 &
232 + (p1%x(3) - p2%x(3))**2 )
237 class(
point_t),
intent(in) :: x
238 real(kind=
rp),
intent(in) :: a(3,3)
246 b%x(i) = b%x(i) + a(i,j) * x%x(j)
integer, parameter, public dp
integer, parameter, public rp
Global precision used in computations.
subroutine point_init_array(this, x, id)
Initialize a point from an array x of coordinates.
pure logical function point_gt(p1, p2)
Check if .
pure logical function point_eq(p1, p2)
Check if .
subroutine point_init_xyz(this, x, y, z, id)
Initialize a point from coordinates.
type(point_t) function point_subtract(p1, p2)
Returns the subtraction of 2 points .
type(point_t) function point_mat_mult(a, x)
Computes matrix-vector product in : .
subroutine point_assign(this, x)
Assigns coordinates x to a point.
type(point_t) function point_scalar_mult(p, a)
Returns the multiplication of a point by a scalar .
pure logical function point_lt(p1, p2)
Check if .
pure real(kind=rp) function point_euclid_dist(p1, p2)
Returns the Euclidean distance between two points .
type(point_t) function point_add(p1, p2)
Returns the addition of 2 points .
pure logical function point_ne(p1, p2)
Check if .
Defines a pointer to a point type.
A point in with coordinates .