dist method

double dist(
  1. PVector v
)

( begin auto-generated from PVector_dist.xml )

Calculates the Euclidean distance between two points (considering a point as a vector object).

( end auto-generated )

@webref pvector:method @usage web_application @param v the x, y, and z coordinates of a PVector @brief Calculate the distance between two points

Implementation

double dist(PVector v) {
  double dx = x - v.x;
  double dy = y - v.y;
  double dz = z - v.z;
  return math.sqrt(dx * dx + dy * dy + dz * dz);
}