aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/plot/libplot/rarc.c
diff options
context:
space:
mode:
authorPetter Rodhelind <petter.rodhelind@gmail.com>2020-01-14 11:41:08 +0100
committerPetter Rodhelind <petter.rodhelind@gmail.com>2020-01-14 11:41:08 +0100
commit02d7aa8915f9c3a3288dab01f321eb94ba219e3b (patch)
treef053238978479e408a2b83571443e132f30586ab /src/cmd/plot/libplot/rarc.c
parentc0c9d8f883dfd3a7f5a74499d91bb95884b15873 (diff)
parent3d1382b98a502d0c34d5ba2c462396acc515016e (diff)
downloadplan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.gz
plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.bz2
plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/cmd/plot/libplot/rarc.c')
-rw-r--r--src/cmd/plot/libplot/rarc.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/cmd/plot/libplot/rarc.c b/src/cmd/plot/libplot/rarc.c
index 9c8ccf15..c0c8c6b3 100644
--- a/src/cmd/plot/libplot/rarc.c
+++ b/src/cmd/plot/libplot/rarc.c
@@ -12,31 +12,31 @@ void rarc(double x1, double y1, double x2, double y2, double xc, double yc, doub
dx = x1 - xc;
dy = y1 - yc;
rd = sqrt(dx * dx + dy * dy);
- if (rd / e1->quantum < 1.0) {
- move(xc, yc);
- vec(xc, yc);
+ if (rd / e1->quantum < 1.0) {
+ move(xc, yc);
+ vec(xc, yc);
return;
}
dph = acos(1.0 - (e1->quantum / rd));
- if (dph > PI4)
+ if (dph > PI4)
dph = PI4;
ph=atan2((y2-yc),(x2 - xc)) - atan2(dy, dx);
- if (ph < 0)
- ph += 6.2832;
- if (rr < 0)
+ if (ph < 0)
+ ph += 6.2832;
+ if (rr < 0)
ph = 6.2832 - ph;
- if (ph < dph)
+ if (ph < dph)
plotline(x1, y1, x2, y2);
else {
- n = ph / dph;
- a = cos(dph);
- b = sin(dph);
- if (rr < 0)
+ n = ph / dph;
+ a = cos(dph);
+ b = sin(dph);
+ if (rr < 0)
b = -b;
move(x1, y1);
while ((n--) >= 0) {
- xnext = dx * a - dy * b;
- dy = dx * b + dy * a;
+ xnext = dx * a - dy * b;
+ dy = dx * b + dy * a;
dx = xnext;
vec(dx + xc, dy + yc);
}