"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Graphics/Types/point.cpp" between
TeXmacs-1.99.4-src.tar.gz and TeXmacs-1.99.5-src.tar.gz

About: GNU TeXmacs is a what-you-see-is-what-you-get scientific text editor, which was both inspired by TeX and GNU Emacs.

point.cpp  (TeXmacs-1.99.4-src):point.cpp  (TeXmacs-1.99.5-src)
skipping to change at line 164 skipping to change at line 164
if (N(p)==1) p= point (p[0], 0.0); if (N(p)==1) p= point (p[0], 0.0);
return point (re * p[0] - im * p[1], return point (re * p[0] - im * p[1],
re * p[1] + im * p[0]); re * p[1] + im * p[0]);
} }
point point
rotate_2D (point p, point o, double angle) { rotate_2D (point p, point o, double angle) {
return mult (cos (angle), sin (angle), p - o) + o; return mult (cos (angle), sin (angle), p - o) + o;
} }
point
slanted (point p, double slant) {
return point (p[0] + p[1] * slant, p[1]);
}
double double
norm (point p) { norm (point p) {
return sqrt (inner (p, p)); return sqrt (inner (p, p));
} }
double double
arg (point p) { arg (point p) {
double n= norm(p); double n= norm(p);
p=p/n; p=p/n;
if (p[1]<0) return 2*tm_PI-acos(p[0]); if (p[1]<0) return 2*tm_PI-acos(p[0]);
skipping to change at line 208 skipping to change at line 213
point ab= ax.p1 - ax.p0; point ab= ax.p1 - ax.p0;
point ba= ax.p0 - ax.p1; point ba= ax.p0 - ax.p1;
point ap= p - ax.p0; point ap= p - ax.p0;
point bp= p - ax.p1; point bp= p - ax.p1;
if (inner (ab, ap) > 0 && inner (ba, bp) > 0) if (inner (ab, ap) > 0 && inner (ba, bp) > 0)
return dist (ax, p); return dist (ax, p);
else else
return min (norm (ap), norm (bp)); return min (norm (ap), norm (bp));
} }
double
seg_dist (point p1, point p2, point p) {
axis ax;
ax.p0= p1;
ax.p1= p2;
return seg_dist (ax, p);
}
bool bool
collinear (point p1, point p2) { collinear (point p1, point p2) {
return fnull (fabs (inner (p1, p2)) - norm(p1)*norm(p2), 1.0e-6); return fnull (fabs (inner (p1, p2)) - norm(p1)*norm(p2), 1.0e-6);
} }
bool bool
linearly_dependent (point p1, point p2, point p3) { linearly_dependent (point p1, point p2, point p3) {
return fnull (norm (p1-p2), 1e-6) || return fnull (norm (p1-p2), 1e-6) ||
fnull (norm (p2-p3), 1e-6) || fnull (norm (p2-p3), 1e-6) ||
fnull (norm (p3-p1), 1e-6) || fnull (norm (p3-p1), 1e-6) ||
 End of changes. 2 change blocks. 
0 lines changed or deleted 13 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS