VBS tutorial: Functions – cos functions


Cos function

Returns the cosine of an angle.


numberThe parameter can be any valid numeric expression that represents an angle as radians.


CosThe function takes an angle and returns the ratio of both sides of a right triangle. This ratio is the ratio of the length of the adjacent edge to the length of the hypotenuse of the angle in a right triangle. The results range from – 1 to 1.

The angle is converted into radians by multiplying the angle by pi / 180. Conversely, the way to convert radians into angles is to multiply radians by 180 / PI.

The following example usesCosFunction returns the cosine of an angle:

Dim myangle, mysecantmyangle = 1.3 'define an angle in radians. Mysecant = 1 / cos (myangle) 'calculates secant.

Recommended Today

The selector returned by ngrx store createselector performs one-step debugging of fetching logic

Test source code: import { Component } from ‘@angular/core’; import { createSelector } from ‘@ngrx/store’; export interface State { counter1: number; counter2: number; } export const selectCounter1 = (state: State) => state.counter1; export const selectCounter2 = (state: State) => state.counter2; export const selectTotal = createSelector( selectCounter1, selectCounter2, (counter1, counter2) => counter1 + counter2 ); // […]