1. Casey Duncan
  2. planar
  3. Issues
Issue #2 new

Planar.c.Vec2.polar under windows and negative angles

g4borg
created an issue

code says more than words:

>>> from planar.py import Vec2
>>> Vec2.polar(-45, 10)
Vec2(7.071067811865474, -7.071067811865477)
>>> from planar.c import Vec2 as Vec2c
>>> Vec2c.polar(-45, 10)
Vec2(9.99848, 0.174524)

I cannot say if planar was compiled using mingw or vc++, it was precompiled 0.4.0 from a distributor. (need to know how to find this out, my windows abilities are somewhat limited)

Comments (4)

  1. g4borg reporter

    maybe needless, but to compare linux:

    >>> from planar.py import Vec2                                                                                                                                   
    >>> Vec2.polar(-45, 10)
    Vec2(7.071067811865474, -7.071067811865477)                                                                                                                      
    >>> from planar.c import Vec2 as Vec2c
    >>> Vec2c.polar(-45, 10)
    Vec2(7.07107, -7.07107)
    
  2. Casey Duncan repo owner

    (Reply via case...@gmail.com):

    My first guess is that this is not a platform-specific issue unless you can demonstrate that it works correctly on MacOS or Linux. I'm not actively maintaining planar, but I may be able to look into it at some point. Feel free to submit a pull request (or whatever the hg equivalent is) with a unit test as well.

    -Casey

  3. g4borg reporter

    I just did demonstrate it works correctly under Linux. The post after my initial post shows Linux resulting in correct numbers, both similar to each other in py and c While in Windows negative polar calls result different vectors only in the C version. It's easily fixable tho by a python lambda for polar in end code, preventing negative numbers to be passed, since its +=360 anyway. needless to say, thats not perfect of course.

    Since I did not compile the C planar library for windows, and downloaded it from a binary pypy repository, I cannot say, whether my version is compiled in MinGW or VisualC.

    planar reports version 0.4.0 in windows.

  4. Log in to comment