rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / manglsl / reflect.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id="reflect">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2011</year>
9 <holder>Khronos Group</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>reflect</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>reflect</refname>
17 <refpurpose>calculate the reflection direction for an incident vector</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>Declaration</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>genType <function>reflect</function></funcdef>
23 <paramdef>genType <parameter>I</parameter></paramdef>
24 <paramdef>genType <parameter>N</parameter></paramdef>
25 </funcprototype>
26 <funcprototype>
27 <funcdef>genDType <function>reflect</function></funcdef>
28 <paramdef>genDType <parameter>I</parameter></paramdef>
29 <paramdef>genDType <parameter>N</parameter></paramdef>
30 </funcprototype>
31 </funcsynopsis>
32 </refsynopsisdiv>
33 <refsect1 id="parameters"><title>Parameters</title>
34 <variablelist>
35 <varlistentry>
36 <term><parameter>I</parameter></term>
37 <listitem>
38 <para>
39 Specifies the incident vector.
40 </para>
41 </listitem>
42 </varlistentry>
43 <varlistentry>
44 <term><parameter>N</parameter></term>
45 <listitem>
46 <para>
47 Specifies the normal vector.
48 </para>
49 </listitem>
50 </varlistentry>
51 </variablelist>
52 </refsect1>
53 <refsect1 id="description"><title>Description</title>
54 <para>
55 For a given incident vector <parameter>I</parameter> and surface normal <parameter>N</parameter> <function>reflect</function> returns
56 the reflection direction calculated as <code><parameter>I</parameter> - 2.0 * <citerefentry><refentrytitle>dot</refentrytitle></citerefentry>(<parameter>N</parameter>, <parameter>I</parameter>) * <parameter>N</parameter></code>.
57 </para>
58 <para>
59 <parameter>N</parameter> should be normalized in order to achieve the desired result.
60 </para>
61 </refsect1>
62 <refsect1 id="versions"><title>Version Support</title>
63 <informaltable frame="topbot">
64 #VARTABLECOLS#
65 <thead>
66 #FUNCTABLEHEADER#
67 <row>
68 <entry>reflect (genType)</entry>#newin11#
69 </row>
70 <row>
71 <entry>reflect (genDType)</entry>#newin40#
72 </row>
73 </thead>
74 </tgroup>
75 </informaltable>
76 </refsect1>
77 <refsect1 id="seealso"><title>See Also</title>
78 <para>
79 <citerefentry><refentrytitle>dot</refentrytitle></citerefentry>,
80 <citerefentry><refentrytitle>refract</refentrytitle></citerefentry>
81 </para>
82 </refsect1>
83 <refsect1 id="Copyright"><title>Copyright</title>
84 <para>
85 Copyright <trademark class="copyright"></trademark> 2011 Khronos Group.
86 This material may be distributed subject to the terms and conditions set forth in
87 the Open Publication License, v 1.0, 8 June 1999.
88 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
89 </para>
90 </refsect1>
91 </refentry>