{ } Raw JSON

bundles / scipy latest / scipy / optimize / _trustregion_constr / qp_subproblem / sphere_intersections

function

scipy.optimize._trustregion_constr.qp_subproblem:sphere_intersections

source: /scipy/optimize/_trustregion_constr/qp_subproblem.py :65

Signature

def   sphere_intersections ( z d trust_radius entire_line = False )

Summary

Find the intersection between segment (or line) and spherical constraints.

Extended Summary

Find the intersection between the segment (or line) defined by the parametric equation x(t) = z + t*d and the ball ||x|| <= trust_radius.

Parameters

z : array_like, shape (n,)

Initial point.

d : array_like, shape (n,)

Direction.

trust_radius : float

Ball radius.

entire_line : bool, optional

When True, the function returns the intersection between the line x(t) = z + t*d (t can assume any value) and the ball ||x|| <= trust_radius. When False, the function returns the intersection between the segment x(t) = z + t*d, 0 <= t <= 1, and the ball.

Returns

ta, tb : float

The line/segment x(t) = z + t*d is inside the ball for for ta <= t <= tb.

intersect : bool

When True, there is a intersection between the line/segment and the sphere. On the other hand, when False, there is no intersection.

Aliases

  • scipy.optimize._trustregion_constr.qp_subproblem.sphere_intersections