Math Class Other Versions
[This documentation is for preview only, and is subject to change in later releases. lan! topics are included as placeholders." #rovides constants and static methods for trigonometric, logarithmic, and other common mathematical functions.
$nheritance %ierarchy &ystem..''..Object
&ystem..''..Math Namespace: &ystem Assembly: mscorlib (in mscorlib.dll)
&ynta* C+ C++ F# JScript VB public static class class Math Math
The
Math type e*poses the following members.
Methods Name
Description
Abs(Double)
Returns the absolute value of a double-precision floating-point floating-point number.
Abs(Int32)
Returns the absolute value of a 32-bit signed integer.
Acos
Returns the angle whose cosine is the specified number. number.
Asin
Returns the angle whose sine is the specified number.
Atan
Returns the angle whose tangent is the specified number.
Atan2
Returns the angle whose tangent is the uotient of two specified numbers.
!eiling
Returns the smallest integral value that is greater than or eual to the specified double-precision floatin
!os
Returns the cosine of the specified angle.
!osh
Returns the h"perbolic cosine of the specified angle.
#$p
Returns e raised to the specified power.
%loor
Returns the largest integer less than or eual to the specified double-precision floating-point number.
I###Remainder
Returns the remainder resulting from the division of a specified number b" another specified number.
&og
Returns the natural (base e) logarithm of a specified number.
&og'
Returns the base ' logarithm of a specified number.
a$(Double* Double)
Returns the larger of two double-precision floating-point numbers.
a$(Int32* Int32)
Returns the larger of two 32-bit signed integers.
in(Double* Double)
Returns the smaller of two double-precision floating-point numbers.
in(Int32* Int32)
Returns the smaller of two 32-bit signed integers.
+ow
Returns a specified number raised to the specified power.
Round
Rounds a double-precision floating-point value to the nearest integral value.
,ign
Returns a value indicating the sign of a double-precision floating-point number.
,in
Returns the sine of the specified angle.
,inh
Returns the h"perbolic sine of the specified angle.
,rt
Returns the suare root of a specified number.
an
Returns the tangent of the specified angle.
anh
Returns the h"perbolic tangent of the specified angle.
runcate
!alculates the integral part of a specified double-precision floating-point number.
Top
ields Name
Description
#
Represents the natural logarithmic base* specified b" the constant* e.
+I
Represents the ratio of the circumference of a circle to its diameter* specified b" the constant* .
Top
Thread &afety -ny public static (Shared in Visual asic) members of this type are thread safe. -ny instance members are not guaranteed to be thread safe.
P1 (AP1) Class Apr 13 2016In-Product View Applies to AutoCAD Civil 3D 2017 !are
Add to Collection
P1 to P1000 is reserved as u"asse#"l$ Points% AP1 to AP1000 are availa"le to represent au&iliar$ points% Function Name
Description
Comments
/et a point0s hori1ontal position, relative to the Origin #oint of &ubassembly.
2*ample'
P1%' •
•
6
$f &ubassembly &ide is 3ight and #4 is on the right of Origin, then #4. is #ositive. $f &ubassembly &ide is 5eft and #4 is on the left of Origin, then #4. is #ositive.
/et a point0s vertical position, relative to the Origin #oint of &ubassembly.
O7set
/et a point0s o7set position, relative to the baseline.
2levation
/et a point0s elevation relative to 8.8.
9istanceTo(:point:)
/et the distance to
$f the subassembly is attached to an o7set baseline, then the o7set value is relative to the o7set baseline.
2*ample'
Function Name
&lopeTo(:point:)
Description
Comments
another point.
P1%Distanceo(P2) or P1%Distanceo(*1%tartPoint)
/et the slope to 2*ample' another point.
P1%lopeo(P2) or P1%lopeo(*1%tartPoint)
$sValid
9etermine whether a target is assigned and is valid to use.
9istanceTo&urface(su /et the vertical rface target) distance to a surface target.
2*ample'
P1%Distanceour+ace(,&istinur+ace).0% •
•
$f #4 is above the surface, a positive value is returned. $f #4 is below the surface, a negative value is returned.
*1 (A*1) Class Apr 13 2016In-Product View Applies to AutoCAD Civil 3D 2017 !are
Add to Collection
*1 to *1000 is reserved as u"asse#"l$ *in/s% A*1 to A*1000 are availa"le to represent au&iliar$ lin/s% Function Name
Description
Comments
&lope
/et the slope of a lin!.
The slope is positive if the lin! is in upward direction.
5ength
/et an absolute length. - positive value is always returned.
length
/et a lin!0s hori1ontal length.
- positive value is always returned.
/et a lin!0s vertical length.
- positive value is always returned.
/et the start point of a lin!.
2*ample'
6length
&tart#oint
2nd#oint
/et the end point of a lin!.
Ma*6
/et the ma*imum 6 elevation from a lin!0s points.
Min6
/et the minimum 6 elevation from the lin!0s points.
o et t!e start points ' *1%tartPoint%'
Function Name
Description
Comments
Ma*$ntercept6(slope)
-pply the highest intercept of a given lin!0s points to the start of another lin!.
!e elevation is relative to riin point%
Min$ntercept6(slope)
-pply the lowest intercept of a given lin!0s points to the start of another lin!.
5inear3egression&lope
9o a linear regression on the points in a lin! to ;nd the best ;t slope between all of them.
!is is used in re!a" su"asse#"lies to +ind t!e critical dept! +or #ill4overla
%$!is is used in re!a" su"asse#"lies to +ind t!e slope o+ t!e e&istin pave#ent% 5ot! o+ t!ese linear reression +unctions are "ased on standard
5inear3egression$nterc ept6
ind the 6 value of the linear regression line (at the start point of the lin!).
$sValid
9etermine whether a target is assigned and is valid to use.
%as$ntersection(5in!<$ 9 as string, 2*tend5in!4 as bool=false, 2*tend5in!< as bool=false)
9etermine whether the !ree para#eters are availa"le current lin! intersects with another lin!. 5in!<$9' string specifying the intersecting lin!. 2nter intersection lin! name in >uotation mar!s. •
•
•
2*tend5in!4' boolean value specifying whether 5in! 4 is e*tended. The default value is alse. 2*tend5in!<' boolean value specifying whether 5in! < is e*tended. The default value is alse.
2*amples'
*1%asIntersection(*2) *1%asIntersection(*2truetrue)
, Class Apr 13 2016In-Product View Applies to AutoCAD Civil 3D 2017 !are
Add to Collection
Function Name
Description
%as5eft5$
3eturn true if left lane inside superelevation slope is present.
%as5eft5O
3eturn true if left lane outside superelevation slope is present.
%as5eft&$
3eturn true if left shouder inside superelevation slope is present.
%as5eft&O
3eturn true if left shouder outside superelevation slope is present.
%as3ight5$
3eturn true if right lane inside superelevation slope is present.
%as3ight5O
3eturn true if right lane outside superelevation slope is present.
%as3ight&$
3eturn true if right shouder inside superelevation slope is present.
Comments
Function Name
Description
%as3ight&O
3eturn true if right shouder outside superelevation slope is present.
5eft5$
3eturn left lane inside superelevation slope.
5eft5O
3eturn left lane outside superelevation slope.
5eft&$
3eturn left shouder inside superelevation slope.
5eft&O
3eturn left shouder outside superelevation slope.
3ight5$
3eturn right lane inside superelevation slope.
3ight5O
3eturn right lane outside superelevation slope.
3ight&$
3eturn right shouder inside superelevation slope.
3ight&O
3eturn right shouder outside superelevation slope.
?
++set aret Class Apr 13 2016In-Product View Applies to AutoCAD Civil 3D 2017 !are
Comments
Add to Collection
Function Name
Description
Comments
$sValid
9etermine whether a target is assigned and is valid to use.
2*ample'
++setaret%IsValid @ote' or an e*ample of the use of the $sValid function, see the 2*ample in the Target #arameters Tab topic.
O7set
/et the o7set value of the 2*ample' target.
++setaret%++set
,levation aret Class Apr 13 2016In-Product View Applies to AutoCAD Civil 3D 2017 !are
Add to Collection
Function Name
Description
Comments
$sValid
9etermine whether a target is assigned and is valid to use.
2*ample'
2levation
,levationaret%IsValid
/et the elevation value of 2*ample'
Function Name
Description
Comments
a target.
,levationaret%,levation
ur+ace aret Class Apr 13 2016In-Product View Applies to AutoCAD Civil 3D 2017 !are
Add to Collection
Function Name
Description
Comments
$sValid
9etermine whether a target is assigned and is valid to use.
2*ample'
ur+acearet%isValid
Parent topic: API 8unctions
5aseline Class Apr 13 2016In-Product View Applies to AutoCAD Civil 3D 2017 !are
Add to Collection
Function Name
Description
&tation
/et the current station on
Comments
Function Name
Description
Comments
the baseline alignment. 2levation
/et the current elevation on the baseline.
3egion&tart
/et the start station of the current region.
3egion2nd
/et the end station of the current region.
/rade
/et the grade of the baseline pro;le at the current station.
Turn9irection
/et the turn direction at 9epending on the result the current station, based found at the current on the curve group. station, the result is returned in one of three ways' •
5eft turn' A4
•
@ot on curve' 8
•
3ight turn' 4
,nu#eration $pe Class Apr 13 2016In-Product View Applies to AutoCAD Civil 3D 2017 !are
Add to Collection
Function Name
Description
Value
3eturn the string value of the current enumeration
Comments
Function Name
Description
Comments
item. Parent topic: API 8unctions
A Class Apr 13 2016In-Product View Applies to AutoCAD Civil 3D 2017 !are
Add to Collection
!is class c!ec/s t!e status o+ an overall su"asse#"l$% Function Name
Description
Comments
$s5ayout
3eturn True if the current preview mode is 5ayout Mode.
2*ample'
Parent topic: API 8unctions
Cant Class Apr 13 2016In-Product View Applies to AutoCAD Civil 3D 2017 !are
A%Is*a$out
Add to Collection
Function Name
Description
Comments
#ivotType
3eturns the pivot method assigned to the current curve.
9epending on the result found at the current station, the result is returned in one of three ways' •
•
•
5eft3ail9elta2levation
3eturns the di7erential elevation for the left rail.
3ight3ail9elta2levation
3eturns the di7erential elevation for the right rail.
Trac!Bidth
$s9e;ned
9etermines whether cant has been calculated on the alignment.
API 8unction ,&a#ples Applies to AutoCAD Civil 3D 2017 !are
8' Center aseline (centerline) 4' %igh &ide 3ail (right rail)
3eturns the Trac! Bidth that is assigned to the alignment.
Parent topic: API 8unctions
Apr 13 2016In-Product View
A4' 5ow &ide 3ail (left rail)
2*ample'
I8(Cant%IsDe+ined rue 8alse)
Add to Collection
9se t!e API +unctions to et para#eter values +ro# ot!er eo#etr$ ele#ents% o see e&a#ples o+ API +unctions open t!e +ollowin a#ple P: +ile API Function Examples.pkt
!e +ollowin ta"le e&plains eac! o+ t!e API +unctions t!at are used in t!is e&a#ple%
Element
A! Function
Description
Cut or ill 9ecision
-#48.6 #4.6
Chec!s whether the 6
Element
A! Function
Description value of -#48 is less than the 6 value of #4' •
•
ill 9ecision
$f alse, the Cut case is used
#4.9istanceTo&urface(&urf Chec!s whether the ace) D < distance between #4 and the &urface is greater than <' •
•
Cut 9ecision
$f True, the ill case is used
$f True, the %igh ill case (slope to the surface at A<88E) is used $f alse, the 5ow ill case (slope the surface at A488E) is used
#4.9istanceTo&urface(&urf Chec!s whether the ace) D A< distance between #4 and the &urface is greater than A<' •
•
$f True, the 9eep Cut case (slope to the surface at 488E) is used $f alse, the &hallow Cut case (slope the surface at <88E) is used
#F &lope
54.&lope
-pply the slope that is calculated for 54.
#F 9elta 6
#<.6 A #G.6
-pply a 6 value that is relative to the vertical distance from the previous point (#G).