Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #1006 #1041

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions xml/chapter2/section4/subsection2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function magnitude_rectangular(z) {
square(imag_part_rectangular(z)));
}
function angle_rectangular(z) {
return math_atan(imag_part_rectangular(z),
return math_atan2(imag_part_rectangular(z),
real_part_rectangular(z));
}
function make_from_real_imag_rectangular(x, y) {
Expand Down Expand Up @@ -297,7 +297,7 @@ function angle_polar(z) { return tail(z); }
function make_from_real_imag_polar(x, y) {
return attach_tag("polar",
pair(math_sqrt(square(x) + square(y)),
math_atan(y, x)));
math_atan2(y, x)));
}
<ALLOW_BREAK/>
function make_from_mag_ang_polar(r, a) {
Expand Down
12 changes: 6 additions & 6 deletions xml/chapter2/section4/subsection3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ function install_rectangular_package() {
return math_sqrt(square(real_part(z)) + square(imag_part(z)));
}
function angle(z) {
return math_atan(imag_part(z), real_part(z));
return math_atan2(imag_part(z), real_part(z));
}
function make_from_mag_ang(r, a) {
return pair(r * math_cos(a), r * math_sin(a));
Expand Down Expand Up @@ -508,7 +508,7 @@ function install_polar_package() {
}
function make_from_real_imag(x, y) {
return pair(math_sqrt(square(x) + square(y)),
math_atan(y, x));
math_atan2(y, x));
}

// interface to the rest of the system
Expand Down Expand Up @@ -1551,7 +1551,7 @@ function make_from_real_imag(x, y) {
: op === "magnitude"
? math_sqrt(square(x) + square(y))
: op === "angle"
? math_atan(y, x)
? math_atan2(y, x)
: error(op, "unknown op -- make_from_real_imag");
}
return dispatch;
Expand All @@ -1567,7 +1567,7 @@ function make_from_real_imag(x, y) {
: op === "magnitude"
? math_sqrt(square(x) + square(y))
: op === "angle"
? math_atan(y, x)
? math_atan2(y, x)
: error(op, "unknown op -- make_from_real_imag");
}
return dispatch;
Expand Down Expand Up @@ -1696,7 +1696,7 @@ function install_rectangular_package() {
square(imag_part(z)));
}
function angle(z) {
return math_atan(imag_part(z), real_part(z));
return math_atan2(imag_part(z), real_part(z));
}
function make_from_mag_ang(r, a) {
return pair(r * math_cos(a), r * math_sin(a));
Expand Down Expand Up @@ -1730,7 +1730,7 @@ function install_polar_package() {
}
function make_from_real_imag(x, y) {
return pair(math_sqrt(square(x) + square(y)),
math_atan(y, x));
math_atan2(y, x));
}

// interface to the rest of the system
Expand Down
4 changes: 2 additions & 2 deletions xml/chapter2/section5/subsection2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ function install_rectangular_package() {
square(imag_part(z)));
}
function angle(z) {
return math_atan(imag_part(z), real_part(z));
return math_atan2(imag_part(z), real_part(z));
}
function make_from_mag_ang(r, a) {
return pair(r * math_cos(a), r * math_sin(a));
Expand Down Expand Up @@ -515,7 +515,7 @@ function install_polar_package() {
}
function make_from_real_imag(x, y) {
return pair(math_sqrt(square(x) + square(y)),
math_atan(y, x));
math_atan2(y, x));
}

// interface to the rest of the system
Expand Down
Loading