Method: Processing::Vector#cross

Defined in:
lib/processing/vector.rb

#cross(v) ⇒ Numeric #cross(x, y) ⇒ Numeric #cross(x, y, z) ⇒ Numeric

Calculates the cross product of 2 vectors.

Parameters:

  • v (Vector)

    a vector

  • x (Numeric)

    x of vector

  • y (Numeric)

    y of vector

  • z (Numeric)

    z of vector

Returns:

  • (Numeric)

    result of cross product

See Also:



546
547
548
549
550
551
# File 'lib/processing/vector.rb', line 546

def cross(a, *rest)
  target = self.class === rest.last ? rest.pop : nil
  v = self.class.new Rays::Point::cross getInternal__, toVector__(a, *rest).getInternal__
  target.set v if self.class === target
  v
end