Commit Graph

14 Commits

Author SHA1 Message Date
Luke Campagnola e29f86578f
Revert Point.angle behavior change (#1806)
* Revert behavior change of Point.angle

* Propagate Point.angle revert
2021-05-27 08:51:06 -07:00
Ogi Moore a534132c62
Various performance improvements to pg.Point (#1741)
This change makes use of QPointF methods which perform faster than the python
equivalent methods.  Furthermore, some tests are added.

* Set __slots__ to empty tuple for pg.Point
* Make Point.angle() behave as Vector.angle()
2021-04-28 21:29:47 -07:00
Ogi Moore 03ea368454 Clean up Errors for CodeQL analyzer
CodeQL identified some errors and warnings, which this commit cleans up.
2021-04-23 22:44:29 -07:00
Ogi Moore b0769f4be9 Use math.radians and math.degrees
Many places in the library were doing radian to degree conversion
via the manual calculation.  Doing timeit benchmarks on my system, I
am able to get a 4x speedup by using math.degrees or math.radians
instead
2021-04-23 22:43:51 -07:00
Ogi Moore 1138c67d45 Use math module trig functions for scalars
This commit replaces the use of np.sin/np.cos/np.tan uses throughout
the library with math.sin/math.cos/math.tan for scalar values
2021-04-23 22:42:46 -07:00
Ogi Moore c4a1cf11a1 Use clip_array or clip_scalar instead of np.clip
Significant performance issues have been identified with np.clip
and thus clip_array was created to speed up the operation.  In addition
clip_scalar was created to clip a scalar value between two other values
this commit replaces many uses of np.clip from operating on scalars to
using clip_scalar instead
2021-04-23 11:53:00 -07:00
Ogi Moore f8cefa6284 Use hypot method to avoid over/underflow errors
Use hypot instead of manual calculation
2021-04-23 11:53:00 -07:00
Ogi Moore b0a3849960 Use math module methods for singular values
Using numpy methods that are intended for vectorized operations is
substantially slower than using the math module, so when feasible the
math module methods should be used.
2021-04-23 11:53:00 -07:00
Kenneth Lyons b058d032d1 Fix some warnings 2020-07-13 21:09:31 -07:00
2xB 8d2c16901b Merge master into develop (#981)
* Information is spelled with an r, even in comments
2019-08-16 20:16:01 -07:00
Luke Campagnola 436fcccf82 Avoid overflow in Point.length by using trig functions or returning inf 2018-04-27 19:07:22 -07:00
Guillaume Poulin f2d0991102 Minor fixes for py3k 2013-07-04 05:52:16 +08:00
Luke Campagnola 8c13a3e7e3 copy from acq4 2013-07-03 11:20:49 -04:00
Luke Campagnola af59296231 Reorganized directory structure to be more standard
Started new SVG exporter
Merged updates from ACQ4
2012-12-25 00:43:31 -05:00