# Description

Calculates the intersection points of three or more spheres using trilateration.

Takes as input a vector array (the world space locations of the sphere centers) and a float array (the radii of the spheres) and returns a vector array representing the points of intersection of the spheres. This may be one or more points depending on the number and arrangement of the spheres.

Can be useful in gap filling. Given a marker whose trajectory has gaps, you can select pairs of markers, each of which consists of the gapped marker and another marker whose distance is consistent from the first throughout the desired range. Each pair then defines a sphere whose center is the position of the second (ungapped) marker and with radius equal to its distance from the gapped marker.

The marker positions and distances can be used as input for the calcIntersection command, which returns the intersection points of the spheres defined by the selected marker pairs. Each returned intersection point is a candidate for the gapped marker position at a given frame. Performing this process for every frame of a gap would allow the gap to be filled.

Results can vary widely. For good results, high-quality, stable input data is required. Use the results of this command with caution.

## Functional area

Math

# Command syntax

## Syntax

`calcIntersection "position array" "radius array"` |

### Arguments

Name | Type | Required | Comments |
---|---|---|---|

`radius` | array | yes | Radii of the spheres |

`position` | array | yes | World space locations of the sphere centers |

### Flags

None

## Return value

vector array