---
name: "BIS_fnc_nearestPoint"
type: function
status: ok
groups: ["Geometry"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_nearestPoint
revid: 328376
updated: 2022-07-13T16:00:48Z
---

# BIS_fnc_nearestPoint

*Function · Geometry · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

Computes nearest point in a line.

## Syntax

```sqf
[start, end, point, is2D] call BIS_fnc_nearestPoint
```

**Parameters:**

- `start`: [Position](../topics/Position.md) - line start
- `end`: [Position](../topics/Position.md) - line end
- `point`: [Position](../topics/Position.md) - point to check against
- `is2D`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) 2D calculation instead of 3D

**Returns:** [Position](../topics/Position.md) - the line point that is closest to *point*

## Examples

### Example 1

```sqf
private _idealLocation = [getMarkerPos "base", getMarkerPos "destination", getPos player, true] call BIS_fnc_nearestPoint;
```

## See also

[nearObjects](../commands/nearObjects.md) · [nearestObject](../commands/nearestObject.md) · [nearestObjects](../commands/nearestObjects.md) · [BIS_fnc_nearestPosition](../functions/BIS_fnc_nearestPosition.md) · [BIS_fnc_nearestNum](../functions/BIS_fnc_nearestNum.md) · [BIS_fnc_nearestRoad](../functions/BIS_fnc_nearestRoad.md) · [BIS_fnc_nearestHelipad](../functions/BIS_fnc_nearestHelipad.md) · [BIS_fnc_isPosBlacklisted](../functions/BIS_fnc_isPosBlacklisted.md)

<sub>Source: [BI Community Wiki — BIS fnc nearestPoint](https://community.bistudio.com/wiki/BIS_fnc_nearestPoint) (revision 328376).</sub>
