#### JMW

##### Aspiring Addon Developer

Hi People.

Quick question, probably not quick answer.....

On a distance calculation I'm getting a value of "-1.#IND" intermittently.

It's messing up an autopilot.

Is it an overrun of some kind.

If so, what do I need to do....?

Code used:

Quick question, probably not quick answer.....

On a distance calculation I'm getting a value of "-1.#IND" intermittently.

It's messing up an autopilot.

Is it an overrun of some kind.

If so, what do I need to do....?

Code used:

Code:

```
dis = sin((latitude)*RAD) * sin((tgtlat)*RAD) + cos((latitude)*RAD) * cos((tgtlat)*RAD) * cos((longitude-tgtlng)*RAD);
dis = acos(dis);
dis = (dis)*DEG;
dis = dis * 6371;
```

Last edited: