math docs
    Preparing search index...

    Function setFromPoints

    • Sets the sphere to enclose a set of points. The center is the center of the points' bounding box and the radius is the distance to the farthest point. This is fast and always encloses every point, but is not the minimal enclosing sphere.

      With no points (n <= 0) the sphere is set to the origin with radius 0. NaN coordinates are not supported and give an unspecified result.

      Parameters

      • out: sphere.Sphere

        the sphere to store the result

      • points: readonly number[]

        points as a flat array [x0, y0, z0, x1, y1, z1, ...]

      • n: number

        number of points to read from points

      Returns sphere.Sphere

      out