- marked as enhancement
Implement 'make-rectangular' and 'make-polar' in scheme
Issue #97
new
make-rectangular should return a complex number with real component real1 and imaginary component real2.
make-polar should return a complex number with magnitude real1 and angle real2.
( http://www.scheme.com/tspl4/objects.html#./objects:s122 )
This should return -2+7i
(make-rectangular -2 7)
Traceback (most recent call last):
File "stdin", line 1, col 2
RunTimeError: unbound variable 'make-rectangular'
This should return 2
(make-polar 2 0)
Traceback (most recent call last):
File "stdin", line 1, col 2
RunTimeError: unbound variable 'make-polar'
Comments (1)
-
- Log in to comment