Click here to Skip to main content
15,884,298 members
Articles / Desktop Programming / MFC

K3DSurf: Math for fun

Rate me:
Please Sign up or sign in to vote.
4.97/5 (137 votes)
11 Dec 20062 min read 210.8K   9.5K   137  
K3DSurf is a program to visualize and manipulate multidimensional surfaces by using Mathematical equations.
/***************************************************************************
 *   Copyright (C) 2005 by Abderrahman Taha                                *
 *   taha_ab@yahoo.fr                                                      *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#include <math.h>

class Matrix5D {
public:
    double xx, xy, xz, xw, xt, xo;
    double yx, yy, yz, yw, yt, yo;
    double zx, zy, zz, zw, zt, zo;
    double wx, wy, wz, ww, wt, wo;
    double tx, ty, tz, tw, tt, to;
    double kx, ky, kz, kw, kt, ko;
    
    double pi;
    public:
    Matrix5D();
    void scale(double );
    void scale_2(double, double, double, double, double);
    void translate(double, double, double, double, double);
    
    void xzrot(double);
    void yzrot(double);
    void xyrot(double);
    void xwrot(double);
    void ywrot(double);
    void zwrot(double);
    void xtrot(double);
    void ytrot(double);
    void ztrot(double);
    void wtrot(double);
    
    
    void mult(Matrix5D);
    void unit();
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions