Flylib.com

Books Software

 
 
 

Asin Function

   
Asin Function

Class

System.Math

Syntax

Math.Asin(


d


)
d (required; Double or any valid numeric expression)

A number representing a sine, which can range from -1 to 1

Return Value

A Double between -pi/2 and pi/2 that is the arcsine of d in radians

Description

Returns the arcsine of d , in radians

Rules at a Glance

  • If d is out of range, the function 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 Asin function did not exist in VB 6.

See Also

Acos Function, Atan Function, Atan2 Function

   
   
Atan Function

Class

System.Math

Syntax

Math.Atan(


d


)
d (required; Double or any valid numeric expression)

A number representing a tangent

Return Value

A Double that is the arctangent in radians of d , in the range -pi/2 to pi/2

Description

Takes the ratio of two sides of a right triangle ( d ) and returns the corresponding angle in radians. The ratio is the length of the side opposite the angle divided by the length of the side adjacent to the angle.

Rules at a Glance

  • If d is out of range, the function returns NaN .

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

Example

Private Sub Main(  )



    Dim dblSideAdj As Double

    Dim dblSideOpp As Double

    Dim dblRatio As Double

    Dim dblAtangent As Double

    

    dblSideAdj = 50.25

    dblSideOpp = 75.5

    

    dblRatio = dblSideOpp / dblSideAdj

    dblAtangent = Math.Atan(dblRatio)

    'convert from radians to degrees

    dblDegrees = dblAtangent * (180 / 3.142)

    MsgBox dblDegrees & " Degrees"



End Sub

Programming Tips and Gotchas

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

  • Do not confuse Atan with the cotangent. Atan is the inverse trigonometric function of Tan , whereas the cotangent is the reciprocal of the tangent.

VB.NET/VB 6 Differences

The Atan function corresponds to the VB 6 Atn intrinsic function.

See Also

Acos Function, Asin Function, Atan2 Function

   
   
Atan2 Function

Class

System.Math

Syntax

Math.Atan2(


y


,


x


)
x (required; Double)

The x coordinate of a point

y (required; Double)

The y coordinate of a point

Return Value

A Double that is the arctangent of the ratio x/y, in radians

Description

Returns the angle in the Cartesian plane formed by the x-axis and a vector starting from the origin (0,0) and terminating at the point (x, y). More specifically , the return value q satisfies the following:

  • For (x, y) in quadrant 1, 0 < q < pi/2.

  • For (x, y) in quadrant 2, pi /2 < q < pi.

  • For ( x, y) in quadrant 3, -pi < q < -pi /2.

  • For ( x, y) in quadrant 4, -pi /2 < q < 0.

Rules at a Glance

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

VB.NET/VB 6 Differences

The Atan2 function does not exist in VB 6.

See Also

Acos Function, Asin Function, Atan Function

   
   
AttributeUsage Attribute

Class

System.AttributeUsageAttribute

Applies to

Class

Description

Defines the program elements to which a custom attribute can be applied. Its use is required when defining a custom attribute.

Constructor

New(


validOn


)
validOn ( System.AttributeTargets )

Indicates the program elements to which a custom attribute can be applied. Possible values are All , Assembly , Class , Constructor , Delegate , Enum , Event , Field , Interface , Struct , Method , Module , Parameter , Property , and ReturnValue .

Properties

AllowMultiple (Boolean)

Indicates whether the attribute can be used more than once on a single program element. Its default value is False .

Inherited (Boolean)

Indicates whether attribute is automatically inherited by derived classes and overridden members . Its default value is True .

ValidOn ( AttributeTargets enumeration)

Read-only. Indicates the program elements to which the attribute can be applied. Its value is set by the required validon parameter of the class constructor.

Example

See Section 8.2 in Chapter 8 for more details and an example.