Giter VIP home page Giter VIP logo

fpa's Introduction

fpa's People

Contributors

bors[bot] avatar japaric avatar regexident avatar withkittens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fpa's Issues

functions to calculate a vectors magnitude and angle

Is there any functions for calculating a vectors magnitude and angle in this library?

I tried using polar() but the results are not what I expected. The following code prints 0.7375122532248497, but it should be 1.41... :

extern crate fpa;

use fpa::I3F29;

fn main() {
    let x = I3F29(1_i32).unwrap();
    let y = I3F29(1_i32).unwrap();
    let (a, _) = x.polar(y);
    println!("{}", a);
}

I've also tried different values, but I never get a value that would be the magnitude of the vector.

Thanks for this library!

support trigonometry, sqrt, exp, log

Any plans to support trigonometry (sin,cos,tan,asin,acos,atan) and other common math functions?
Something like libfixmath

As a vectoring-mode cordic is already implemented, a rotation-mode cordic should be easy to do and compute sin/cos....

Any support for 64 bit numbers?

Hi @japaric, from looking through the code it appears there aren't any 64 bit representations. Is that true, or am I reading it wrong? There's a lot of macro magic going on so maybe I'm missing it.

I'm looking for a fixed point implementation for a game physics engine I'm working on, and of the several options fpa appears to be the only one with any built-in trig support.

There is no I0F32

I use this in many places in my programs. You could also add all the way up to I0F64 - I64F0 once u128 and i128 are stabilized in the coming months

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.