📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

POINT_IN_ELLIPSES



Returns 1 if the point lies inside any of the provided ellipses, otherwise returns 0. Each ellipse is defined by a center point and its semi-major and semi-minor axes.

Syntax

POINT_IN_ELLIPSES(x, y, x1, y1, a1, b1 [, x2, y2, a2, b2, ...])

Arguments

ArgumentsDescription
x, yCoordinates of the point to test.
x1, y1Center of the first ellipse.
a1, b1Semi-major and semi-minor axis lengths of the first ellipse.
x2, y2, a2, b2, ...Optional additional ellipses, defined the same way.

Return Type

UInt8 (1 for true, 0 for false).

Examples

SELECT POINT_IN_ELLIPSES(10, 10, 10, 9.1, 1, 0.9999) AS inside; ╭────────╮ │ inside │ ├────────┤ │ 1 │ ╰────────╯

Was this page helpful?