Name

Acos Function

Class

System.Math

Syntax

Math.Acos(d)
d (required; Double or any valid numeric expression)

A cosine, which is a number greater than or equal to -1 and less than or equal to 1

Return Value

A Double between 0 and pi that is the arccosine of d in radians

Description

Returns the arccosine of d in radians

Rules at a Glance

  • If d is out of range (less than -1 or greater than 1), Acos returns NaN.

  • This is a Shared member, so it can be used without creating any objects.

Programming Tips and Gotchas

To convert from radians to degrees, multiply by 180/pi.

VB.NET/VB 6 Differences

The Acos function did not exist in VB 6.

Get VB.NET Language in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.