# HG changeset patch # User Markus Mützel # Date 1714055065 -7200 # Thu Apr 25 16:24:25 2024 +0200 # Node ID 7d937f07e7065740e0da74017a9cf0111d4b83d4 # Parent 2a0cdc52220b185bc2fbac31731b7ec64c2f6a85 view.m: Improve input with view point on main axis (bug #65641). * view.m: Rotate input to cart2sph by 90° instead of its output. diff -r 2a0cdc52220b -r 7d937f07e706 scripts/plot/appearance/view.m --- a/scripts/plot/appearance/view.m Wed Apr 24 17:29:17 2024 -0400 +++ b/scripts/plot/appearance/view.m Thu Apr 25 16:24:25 2024 +0200 @@ -72,11 +72,13 @@ az = x(1); el = x(2); elseif (numel (x) == 3) - [az, el] = cart2sph (x(1), x(2), x(3)); + if (x(2) == 0) + ## special case for negative 0 + [az, el] = cart2sph (x(2), x(1), x(3)); + else + [az, el] = cart2sph (-x(2), x(1), x(3)); + endif az *= 180/pi; - if (az != 0) - az += 90; # Special fix for bug #57800 - endif el *= 180/pi; elseif (x == 2) az = 0;