Vecpac, a vector and geometry library

Sorry, this product is no longer being sold.

last updated December 15, 2005

Overview

Powerful vector and geometry routines for C++.

Vectors in 2-D, vectors in 3-D, dot product, cross product, rotation matrices, points, lines, planes, circles, ellipses, spheres, ellipsoids, and intersections between them.

A free student version is available, with basic functionality.
The professional version is full featured and includes all the intersect() routines.

Purpose

Features

Caution

Don't try to build one of these at home! Testing it to perfection would cost much more than $10 worth of your time.

Background

I wrote Vecpac in 1998. I've used it for years in my orbital mechanics projects.

Code Example

    // Dot Product 

    vector2_t   v2a(1, -2); 
    vector3_t   v3a(4, 5, -6); 
    
    cout << "Dots:  " << v2a << " • " << v3a << " = " << dot(v2a, v3a) 
         << endl ;

    // Cross Product 

    vector3_t   v3b(4, 5, -6); 
    vector3_t   v3c(7, 8, 9); 

    cout << "Cross: " << v3b << " x " << v3c << " = " << cross(v3b, v3c) 
         << endl ;

    // Convenient Basic Operations: 

    vector3_t   v3e(4, 5, -6); 
    vector3_t   v3f(7, 8, 9); 

    cout << "+:     " << v3e << " + "  << v3f << " = " << v3e + v3f      << endl ;
    cout << "-:     " << v3e << " - "  << v3f << " = " << v3e - v3f      << endl ;
    cout << "*:     " << 1.5 << " * "  << v3f << " = " << 1.5 * v3f      << endl ;
    cout << "*:     " << v3f << " * "  << 2   << " = " << v3f * 2        << endl ;
    cout << "/:     " << v3f << " / "  << 2   << " = " << v3f / 2        << endl ;
    cout << "==:    " << v3e << " == " << v3f << " = " << (v3e == v3f)   << endl ;
    cout << "==:    " << v3e << " == " << v3e << " = " << (v3e == v3e)   << endl ;
    cout << "veclen " << v3e << " = "  << veclen(v3e)                    << endl ;
	

Output:

    Dots:  (1, -2) • (4, 5, -6) = -6
    Cross: (4, 5, -6) x (7, 8, 9) = (93, -78, -3)
    +:     (4, 5, -6) + (7, 8, 9) = (11, 13, 3)
    -:     (4, 5, -6) - (7, 8, 9) = (-3, -3, -15)
    *:     1.5 * (7, 8, 9) = (10.5, 12, 13.5)
    *:     (7, 8, 9) * 2 = (14, 16, 18)
    /:     (7, 8, 9) / 2 = (3.5, 4, 4.5)
    ==:    (4, 5, -6) == (7, 8, 9) = 0
    ==:    (4, 5, -6) == (4, 5, -6) = 1
    veclen (4, 5, -6) = 8.77496
	

Pricing

Vecpac is provided in three editions:


Availability

As of December 15, 2005, Vecpac demo code (Copper Edition) is available. (Download)
Gold Edition code will be produced for customers who show an interest after evaluating the Copper Edition.


The Product



Contact

Copyright © 2005-2006  J. E. Brown   all rights reserved.

              
Los Alamos, NM  USA