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">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>reflect
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>reflect
</refname>
17 <refpurpose>calculate the reflection direction for an incident vector
</refpurpose>
19 <refsynopsisdiv><title>Declaration
</title>
22 <funcdef>genType
<function>reflect
</function></funcdef>
23 <paramdef>genType
<parameter>I
</parameter></paramdef>
24 <paramdef>genType
<parameter>N
</parameter></paramdef>
27 <funcdef>genDType
<function>reflect
</function></funcdef>
28 <paramdef>genDType
<parameter>I
</parameter></paramdef>
29 <paramdef>genDType
<parameter>N
</parameter></paramdef>
33 <refsect1 id=
"parameters"><title>Parameters
</title>
36 <term><parameter>I
</parameter></term>
39 Specifies the incident vector.
44 <term><parameter>N
</parameter></term>
47 Specifies the normal vector.
53 <refsect1 id=
"description"><title>Description
</title>
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>.
59 <parameter>N
</parameter> should be normalized in order to achieve the desired result.
62 <refsect1 id=
"versions"><title>Version Support
</title>
63 <informaltable frame=
"topbot">
68 <entry>reflect (genType)
</entry>#newin11#
71 <entry>reflect (genDType)
</entry>#newin40#
77 <refsect1 id=
"seealso"><title>See Also
</title>
79 <citerefentry><refentrytitle>dot
</refentrytitle></citerefentry>,
80 <citerefentry><refentrytitle>refract
</refentrytitle></citerefentry>
83 <refsect1 id=
"Copyright"><title>Copyright
</title>
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>.