Introduction
In this article, I am describing some of the TypeScript math functions.
In TypeScript the asin() method returns a numeric value between -pi/2 and pi/2 radians for x between -1 and 1. If the value of a number is outside this range then it returns NaN.
Syntax
Asin() function
- asin (number)
function
- Asin(num: number) {
- var span = document.createElement("span");
- span.innerText = "The arcsine of " + num + " is -> " + Math.asin(num) + "\n";
- document.body.appendChild(span);
- }
Acos() function
- acos (number)
function
- Acos(num: number) {
- var span = document.createElement("span");
- span.innerText = "The arccosine of " + num + " is -> " + Math.acos(num) + "\n";
- document.body.appendChild(span);
- }
Atan() function
Syntax
- acos(number)
function
- Atan(num: number) {
- var span = document.createElement("span");
- span.innerText = "The arctangent of " + num + " is -> " + Math.atan(num);
- document.body.appendChild(span);
- }
Complete Program
Function.ts
- class Greeter {
- Asin(num: number) {
- var span = document.createElement("span");
- span.innerText = "The arcsine of " + num + " is -> " + Math.asin(num) + "\n";
- document.body.appendChild(span);
- }
- Acos(num: number) {
- var span = document.createElement("span");
- span.innerText = "The arccosine of " + num + " is -> " + Math.acos(num) + "\n";
- document.body.appendChild(span);
- }
- Atan(num: number) {
- var span = document.createElement("span");
- span.innerText = "The arctangent of " + num + " is -> " + Math.atan(num);
- document.body.appendChild(span);
- }
- }
- window.onload = () => {
- var obj = new Greeter();
- var num = parseFloat(prompt("Enter a number for calculate Asin,Acos and Atan"));
- obj.Asin(num);
- obj.Acos(num);
- obj.Atan(num);
- };



Join the conversation! Your thoughts help the community grow.