A standalone C++ Library for vectors calculations
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
tests
.gitignore
.travis.yml
LICENSE
README.md
_config.yml

README.md


Firefly Build Status

A standalone C++ Library for vectors calculations

Installation

  1. Download the repository or clone
git clone https://github.com/tbhaxor/firefly.git
  1. Change the directory to firefly
$ cd firefly
  1. Copy the file named with firefly and firefly.hpp to the includes directory of your compiler

Datatypes and classes

  1. vector of float type
  2. Vectors class of firefly

Features

  1. Addition of two vectors
  2. Subtraction of two vectors
  3. Scalor Multiplication of the floating number with Vector
  4. Find vector magnitude
  5. Find normalized form of the vector i.e unit vector
  6. Find dot product of two vectors
  7. Find cross product of two vectors
  8. Find area of parallelogram formed by two vectors
  9. Find area of triangle formed by two vectors
  10. Find angle between two vector in degrees or radians
  11. Check whether the two vectors are parallel to each other or not
  12. Check whether the two vectors are orthogonal to each other or not
  13. Find a component of vector parallel to base vector while vector projection
  14. Find a component of vector orthogonal to base vector while vector projection

Example

Here I will demonstrate you a function to print vector components
Note : The following code will work if you have added both firefly and firefly.hpp to the includes directory of your compiler

#include <firefly>
#include <iostream> // for io operations
#include <vector>  // for dynamic arrays :P
using namespace std;

int main() {
  vector<float> array = {1, 2, 3};
  Vectors vec1(array);  // Vectors is the class in firefly 
  vec1.print();   // print is the method of class
  return 0;
}

OUTPUT

[1, 2, 3, ]

CONTRIBUTION

To contribute open a Pull Request from new branch

Contact Me

fb gh mail