I have two variables with longitude and latitude values. Now i want to calculate these variables into x and y values, but i need the cosine function for that. XSL only supports plus, divide and so on...
How i can calculate cosine in XSL 1.0?
<xsl:variable name="lat" select="some value"/>
<xsl:variable name="lon" select="some value"/>
<xsl:variable name="x" select="?? do some crazy calculate with cosine ??"/>
<xsl:variable name="y" select="?? do some crazy calculate with cosine ??"/>
Thanks for Help!
I believe the FXSL 1.0 library from Dimitre Novachev includes pure XSLT 1.0 code to calculate trigonometric functions. An extension function would probably be faster, but a pure XSLT implementation is more portable.
There is no function for cosine in standard XSLT 1.0, but check out EXSLT, specifically the math:cos()
function:
Implementer Page: math.cos.html
Function Package: math.cos.zip
function syntax
number math:cos(number)
The math:cos function returns cosine of the passed argument in radians.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With