compass/doc-src/content/reference/compass/helpers/trig.haml
2010-11-12 15:57:03 -08:00

58 lines
1.6 KiB
Plaintext

---
title: Compass Trigonometric Helpers
crumb: Trig
framework: compass
meta_description: Helper functions for working with angles.
layout: core
classnames:
- reference
- core
- helpers
---
%h1 Compass Trig Helpers
:markdown
Trigonometric functions can help you manage complex calculations involving angles.
Or maybe they can be used to create pretty pictures. Who knows?
#pi.helper
%h3
%a(href="#pi")
pi()
.details
%p
Returns the value of π.
#sin.helper
%h3
%a(href="#sin")
sin($number)
.details
%p
Takes the sine of a number. If the number is unitless or has a unit of <code>deg</code>
then it will return a unitless result. Degrees will first be converted to radians.
If the number is any other unit, the units will be passed thru to the result,
and the number will be treated as radians.
#cos.helper
%h3
%a(href="#cos")
cos($number)
.details
%p
Takes the cosine of a number. If the number is unitless or has a unit of <code>deg</code>
then it will return a unitless result. Degrees will first be converted to radians.
If the number is any other unit, the units will be passed thru to the result,
and the number will be treated as radians.
#tan.helper
%h3
%a(href="#tan")
tan($number)
.details
%p
Takes the tangent of a number. If the number is unitless or has a unit of <code>deg</code>
then it will return a unitless result. Degrees will first be converted to radians.
If the number is any other unit, the units will be passed thru to the result,
and the number will be treated as radians.