Skip to Content
GPGPU Programming for Games and Science
book

GPGPU Programming for Games and Science

by David H. Eberly
August 2014
Intermediate to advanced
469 pages
16h 30m
English
A K Peters/CRC Press
Content preview from GPGPU Programming for Games and Science
Linear and Affine Algebra 297
A straightforward implementation of quaternions and the associated alge-
bra is provided by the interface shown in Listing 6.27. The
Rotate and Slerp
functions are discussed later in this section.
template <typename Real>
class Quaternion : public Vector <4, R eal >
{
public :
// The quaternions are of the form q = x i+y j+zk + w. In tuple
// form, q = (x,y,z,w).
// Construction and destruction . The default constructor does not
// initialize the members.
˜Quaternion ();
Quaternion ();
Quaternion (Quaternion const&q);
Quaternion ( Vector <4, R ea l> const&q);
Quaternion ( Real x , Real y , Real z , Real w);
// assignment
Quaternion& operator=(Quaternion const&q);
Quaternion& operator= ( Vector <4, R ea l> const&q);
// special quaternions ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Graphics Gems V (IBM Version)

Graphics Gems V (IBM Version)

Alan W. Paeth
GPU Pro 6

GPU Pro 6

Wolfgang Engel

Publisher Resources

ISBN: 9781466595354