1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>cross_product</title> 5<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../../index.html" title="Chapter 1. Geometry"> 8<link rel="up" href="../arithmetic.html" title="Arithmetic"> 9<link rel="prev" href="assign_value.html" title="assign_value"> 10<link rel="next" href="cross_product_2_0.html" title="cross_product"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="assign_value.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../arithmetic.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="cross_product_2_0.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h4 class="title"> 27<a name="geometry.reference.arithmetic.cross_product_2"></a><a class="link" href="cross_product_2.html" title="cross_product">cross_product</a> 28</h4></div></div></div> 29<p> 30 <a class="indexterm" name="idm45635686077024"></a> 31Computes the cross product of two vectors. 32 </p> 33<h6> 34<a name="geometry.reference.arithmetic.cross_product_2.h0"></a> 35 <span class="phrase"><a name="geometry.reference.arithmetic.cross_product_2.description"></a></span><a class="link" href="cross_product_2.html#geometry.reference.arithmetic.cross_product_2.description">Description</a> 36 </h6> 37<p> 38 All vectors should have the same dimension, 3 or 2. 39 </p> 40<h6> 41<a name="geometry.reference.arithmetic.cross_product_2.h1"></a> 42 <span class="phrase"><a name="geometry.reference.arithmetic.cross_product_2.synopsis"></a></span><a class="link" href="cross_product_2.html#geometry.reference.arithmetic.cross_product_2.synopsis">Synopsis</a> 43 </h6> 44<p> 45</p> 46<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">ResultP</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">P1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">P2</span><span class="special">></span> 47<span class="identifier">ResultP</span> <span class="identifier">cross_product</span><span class="special">(</span><span class="identifier">P1</span> <span class="keyword">const</span> <span class="special">&</span> <span class="identifier">p1</span><span class="special">,</span> <span class="identifier">P2</span> <span class="keyword">const</span> <span class="special">&</span> <span class="identifier">p2</span><span class="special">)</span></pre> 48<p> 49 </p> 50<h6> 51<a name="geometry.reference.arithmetic.cross_product_2.h2"></a> 52 <span class="phrase"><a name="geometry.reference.arithmetic.cross_product_2.parameters"></a></span><a class="link" href="cross_product_2.html#geometry.reference.arithmetic.cross_product_2.parameters">Parameters</a> 53 </h6> 54<div class="informaltable"><table class="table"> 55<colgroup> 56<col> 57<col> 58<col> 59<col> 60</colgroup> 61<thead><tr> 62<th> 63 <p> 64 Type 65 </p> 66 </th> 67<th> 68 <p> 69 Concept 70 </p> 71 </th> 72<th> 73 <p> 74 Name 75 </p> 76 </th> 77<th> 78 <p> 79 Description 80 </p> 81 </th> 82</tr></thead> 83<tbody> 84<tr> 85<td> 86 <p> 87 ResultP 88 </p> 89 </td> 90<td> 91 </td> 92<td> 93 <p> 94 - 95 </p> 96 </td> 97<td> 98 <p> 99 Must be specified 100 </p> 101 </td> 102</tr> 103<tr> 104<td> 105 <p> 106 P1 const & 107 </p> 108 </td> 109<td> 110 </td> 111<td> 112 <p> 113 p1 114 </p> 115 </td> 116<td> 117 <p> 118 first vector 119 </p> 120 </td> 121</tr> 122<tr> 123<td> 124 <p> 125 P2 const & 126 </p> 127 </td> 128<td> 129 </td> 130<td> 131 <p> 132 p2 133 </p> 134 </td> 135<td> 136 <p> 137 second vector 138 </p> 139 </td> 140</tr> 141</tbody> 142</table></div> 143<h6> 144<a name="geometry.reference.arithmetic.cross_product_2.h3"></a> 145 <span class="phrase"><a name="geometry.reference.arithmetic.cross_product_2.returns"></a></span><a class="link" href="cross_product_2.html#geometry.reference.arithmetic.cross_product_2.returns">Returns</a> 146 </h6> 147<p> 148 the cross product vector 149 </p> 150<h6> 151<a name="geometry.reference.arithmetic.cross_product_2.h4"></a> 152 <span class="phrase"><a name="geometry.reference.arithmetic.cross_product_2.header"></a></span><a class="link" href="cross_product_2.html#geometry.reference.arithmetic.cross_product_2.header">Header</a> 153 </h6> 154<p> 155 <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">arithmetic</span><span class="special">/</span><span class="identifier">cross_product</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code> 156 </p> 157</div> 158<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 159<td align="left"></td> 160<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam 161 Wulkiewicz, Oracle and/or its affiliates<p> 162 Distributed under the Boost Software License, Version 1.0. (See accompanying 163 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 164 </p> 165</div></td> 166</tr></table> 167<hr> 168<div class="spirit-nav"> 169<a accesskey="p" href="assign_value.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../arithmetic.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="cross_product_2_0.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 170</div> 171</body> 172</html> 173