Package: graphene

Function graphene:point3d-distance

Lambda List

graphene:point3d-distance (a b delta)

Syntax

(graphene:point-distance a b) => dist, delta

Arguments

a -- a graphene:point3d-t instance
b -- a graphene:point3d-t instance
delta -- a graphene:vec3-t instance with the calculated distance components on the x, y, and z axis
dist -- a float with the distance between two points

Details

Computes the distance between the two given points.

Example

(graphene:with-vec3 (v)
  (graphene:with-point3ds ((p1 0 0 0) (p2 1 1 1))
    (multiple-value-bind (dist delta)
        (graphene:point3d-distance p1 p2 v)
      (values dist
              (graphene:vec3-to-float delta)))))
=> 1.7320508
=> (1.0 1.0 1.0)    
 

See also

2024-1-20