xref: /aosp_15_r20/external/apache-xml/test/tests/exslt/math/math5.xsl (revision 1212f9a0ffdc28482b8821715d2222bf16dc14e2)
1<?xml version="1.0"?>
2<xsl:stylesheet version="1.0"
3                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4                xmlns:math="http://exslt.org/math"
5                extension-element-prefixes="math">
6
7<!-- Test math:atan2() -->
8
9<xsl:variable name="zero" select="0"/>
10<xsl:variable name="nzero" select="-0"/>
11<xsl:variable name="num1" select="1.99"/>
12<xsl:variable name="num2" select="3.1428475"/>
13<xsl:variable name="temp1" select="-7"/>
14<xsl:variable name="temp2" select="-9.99999"/>
15<xsl:variable name="rad1" select="1.0"/>
16<xsl:variable name="rad2" select="25"/>
17<xsl:variable name="rad3" select="0.253"/>
18<xsl:variable name="rad4" select="-0.888"/>
19<xsl:variable name="input1" select="number(//number[1])"/>
20<xsl:variable name="input2" select="number(//number[2])"/>
21<xsl:variable name="input3" select="$input1 div $zero"/>
22
23<xsl:template match="/">
24   <out>
25
26      ArcTan2 value of zero is:
27      <xsl:value-of select="math:atan2($zero)"/><br/>
28      ArcTan2 value of nzero is:
29      <xsl:value-of select="math:atan2($nzero)"/><br/>
30      ArcTan2 value of num1 is:
31      <xsl:value-of select="math:atan2($num1)"/><br/>
32      ArcTan2 value of num2 is:
33      <xsl:value-of select="math:atan2($num2)"/><br/>
34      ArcTan2 value of temp1 is:
35      <xsl:value-of select="math:atan2($temp1)"/><br/>
36      ArcTan2 value of temp2 is:
37      <xsl:value-of select="math:atan2($temp2)"/><br/>
38      ArcTan2 value of rad1 is:
39      <xsl:value-of select="math:atan2($rad1)"/><br/>
40      ArcTan2 value of rad2 is:
41      <xsl:value-of select="math:atan2($rad2)"/><br/>
42      ArcTan2 value of rad3 is:
43      <xsl:value-of select="math:atan2($rad3)"/><br/>
44      ArcTan2 value of rad4 is:
45      <xsl:value-of select="math:atan2($rad4)"/><br/>
46      ArcTan2 value of input1 number is:
47      <xsl:value-of select="math:atan2($input1)"/><br/>
48      ArcTan2 value of input2 number is:
49      <xsl:value-of select="math:atan2($input2)"/><br/>
50      ArcTan2 value of input3 number is:
51      <xsl:value-of select="math:atan2($input3)"/>
52   </out>
53</xsl:template>
54
55
56  <!--
57   * Licensed to the Apache Software Foundation (ASF) under one
58   * or more contributor license agreements. See the NOTICE file
59   * distributed with this work for additional information
60   * regarding copyright ownership. The ASF licenses this file
61   * to you under the Apache License, Version 2.0 (the  "License");
62   * you may not use this file except in compliance with the License.
63   * You may obtain a copy of the License at
64   *
65   *     http://www.apache.org/licenses/LICENSE-2.0
66   *
67   * Unless required by applicable law or agreed to in writing, software
68   * distributed under the License is distributed on an "AS IS" BASIS,
69   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
70   * See the License for the specific language governing permissions and
71   * limitations under the License.
72  -->
73
74</xsl:stylesheet>
75