Skip to content

Commit

Permalink
fixes #1006 (#1041)
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-henz authored Jul 10, 2024
1 parent f495d48 commit 5794483
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
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

0 comments on commit 5794483

Please sign in to comment.