From: Kenta Murata Date: 2012-02-14T00:58:46+09:00 Subject: [ruby-core:42559] [ruby-trunk - Feature #1316][Rejected] Phasor.rb: Complex number class using polar coordinates Issue #1316 has been updated by Kenta Murata. Status changed from Assigned to Rejected I think these features are provided as a gem. ---------------------------------------- Feature #1316: Phasor.rb: Complex number class using polar coordinates https://bugs.ruby-lang.org/issues/1316 Author: Peter Hillerstr��m Status: Rejected Priority: Low Assignee: Kenta Murata Category: Target version: 2.0.0 =begin Hello! I am writing a sound synthesis program, and I needed a way to easily generate and manipulate complex sound samples (analytic signal), so I wrote a new class by adapting the Ruby Complex Number class by Keiju ISHITSUKA to make calculations using polar coordinates. I know the complex number class in 1.9 is written in C, but I hope this would inspire someone to make a C version using polar coordinates too... Anyway, do what you wish with this. As I mainly needed to multiply and add phasors with scalars, some methods may have bugs or inaccuracies with complex arguments. There are still some weirdness in substraction (2 tests fail), and most of the trigonometry functions are absent. I tried to use svn diff to make a patch file out of the class, but that didn't work as expected - diff didn't see my file at all, but instead tried to diff against several other files, so I will just attach the file and unit tests here. Sincerely, Peter H. =end -- http://bugs.ruby-lang.org/