epix-1.2.22/0000755000175000017500000000000014235777646011562 5ustar hwanghwangepix-1.2.22/axis.h0000644000175000017500000001500114167400347012655 0ustar hwanghwang/* * axis.h -- Decorable coordinate axis class * * This file is part of ePiX, a C++ library for creating high-quality * figures in LaTeX * * Version 1.1.13 * Last Change: August 23, 2007 */ /* * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 * Andrew D. Hwang * Department of Mathematics and Computer Science * College of the Holy Cross * Worcester, MA, 01610-2395, USA */ /* * ePiX is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * ePiX is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public License * along with ePiX; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef EPIX_AXIS #define EPIX_AXIS #include #include #include "enums.h" #include "triples.h" namespace ePiX { class axis { public: axis(const P&, const P&, unsigned int n, const P& offset = P(0,0), epix_label_posn POSN=none); // attribute-setting axis& dec(); // default axis& frac(); // fractional labels axis& trig(); // fractions times pi axis& sci(); // scientific notation // f(x, precision, base) returns a string representing x axis& label_rep(std::string f(double, unsigned int, unsigned int)); // unmark selected location (non-log labels only) axis& unmark(double arg=0); // add or remove logarithmic tags ("sublabels") axis& log(unsigned int base=10); // log ticks and labels axis& tag(double); // put label at arg in log mode axis& tag235(); // tags at 2, 3, 5 in log10 mode axis& tags(); // tags at 2, ..., b-1 in logb mode axis& untag(); // remove all log tags axis& untag(double); // remove selected tag axis& align_labels(epix_label_posn); axis& align(epix_label_posn); // align tick marks // number of minor ticks per segment axis& subdivide(unsigned int); // set length of minor ticks axis& tick_ratio(double); // set precision for axis labels axis& precision(unsigned int digits=0); // 0: reset to default void draw_ticks() const; void draw_labels() const; void draw() const; private: P m_tail; P m_head; unsigned int m_major_segs; unsigned int m_minor_segs; double m_tick_ratio; epix_label_posn m_align_ticks; P m_offset; epix_label_posn m_align_labels; unsigned int m_log_base; bool m_log; unsigned int m_precision; double (*m_coord)(const P&); // value to place at arg // represent arg as string std::string (*m_rep)(double arg, unsigned int prec, unsigned int base); std::set m_omitted; std::set m_log_tags; }; // end of axis class // axes along sides of bounding box, ticks automatically aligned axis top_axis(unsigned int n, const P& offset=P(0,0), epix_label_posn POSN=t); axis bottom_axis(unsigned int n, const P& offset=P(0,0), epix_label_posn POSN=b); axis left_axis(unsigned int n, const P& offset=P(0,0), epix_label_posn POSN=l); axis right_axis(unsigned int n, const P& offset=P(0,0), epix_label_posn POSN=r); // Global functions from Version 1.0 void h_axis_labels(const P& tail, const P& head, unsigned int n, const P& offset, epix_label_posn POSN=none); void v_axis_labels(const P& tail, const P& head, unsigned int n, const P& offset, epix_label_posn POSN=none); void h_axis_masklabels(const P& tail, const P& head, unsigned int n, const P& offset, epix_label_posn POSN=none); void v_axis_masklabels(const P& tail, const P& head, unsigned int n, const P& offset, epix_label_posn POSN=none); // Axis labels with default endpoints void h_axis_labels(unsigned int n, const P& offset, epix_label_posn POSN=none); void h_axis_masklabels(unsigned int n, const P& offset, epix_label_posn POSN=none); void v_axis_labels(unsigned int n, const P& offset, epix_label_posn POSN=none); void v_axis_masklabels(unsigned int n, const P& offset, epix_label_posn POSN=none); //// logarithmic labels //// // labels written $k x base^i$ at i + log_b(k) void h_axis_log_labels(const P& tail, const P& head, unsigned int n, const P& offset, epix_label_posn POSN=none, unsigned int base=10); void v_axis_log_labels(const P& tail, const P& head, unsigned int n, const P& offset, epix_label_posn POSN=none, unsigned int base=10); // labels written $base^i$ at coord i void h_axis_log_labels(const P& tail, const P& head, const P& offset, epix_label_posn POSN=none, unsigned int base=10); void v_axis_log_labels(const P& tail, const P& head, const P& offset, epix_label_posn POSN=none, unsigned int base=10); void h_axis_log_masklabels(const P& tail, const P& head, unsigned int n, const P& offset, epix_label_posn POSN=none, unsigned int base=10); void v_axis_log_masklabels(const P& tail, const P& head, unsigned int n, const P& offset, epix_label_posn POSN=none, unsigned int base=10); void h_axis_log_masklabels(const P& tail, const P& head, const P& offset, epix_label_posn POSN=none, unsigned int base=10); void v_axis_log_masklabels(const P& tail, const P& head, const P& offset, epix_label_posn POSN=none, unsigned int base=10); // Coordinate axes, specified by initial and final points, number of // tick marks. h/v_axis are identical except for style of tick marks. // n subintervals void h_axis(const P& tail, const P& head, unsigned int n, epix_label_posn align=c); void v_axis(const P& tail, const P& head, unsigned int n, epix_label_posn align=c); // Default endpoints (xmin(), 0), xmax(), 0), etc. void h_axis(unsigned int n = xsize(), epix_label_posn align=c); void v_axis(unsigned int n = ysize(), epix_label_posn align=c); void h_log_axis(const P& tail, const P& head, unsigned int segs, epix_label_posn align=c, unsigned int base=10); void v_log_axis(const P& tail, const P& head, unsigned int segs, epix_label_posn align=c, unsigned int base=10); } // end of namespace #endif /* EPIX_AXIS */ epix-1.2.22/tikz.h0000644000175000017500000001066414167400347012704 0ustar hwanghwang/* * tikz.h -- ePiX::tikz output format * * This file is part of ePiX, a C++ library for creating high-quality * figures in LaTeX * * Version 1.1.15 * Last Change: September 07, 2007 * * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 * Andrew D. Hwang * Department of Mathematics and Computer Science * College of the Holy Cross * Worcester, MA, 01610-2395, USA * * * ePiX is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * ePiX is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public License * along with ePiX; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef EPIX_TIKZ #define EPIX_TIKZ #include #include #include #include "edge_data.h" namespace ePiX { class Color; class pair; class path_state; class pen_data; class tikz : public format { public: tikz(); // Return a copy of this tikz* clone() const; // Filled region with specified Cartesian edges, offset, and color std::string print_fill(const std::list& edges, const pair& offset, const Color& fill, const pen_data& line, const std::string& len) const; // Unfilled region, specified Cartesian edges. Should generally be // trivially implemented using one-pen function (supplied). std::string print_line(const std::list& edges, const pair& offset, const pen_data& line_pen, const pen_data& base_pen, const path_state& style, const std::string& len) const; /* * Picture start and finish: * Size and offset in page units, * palette (set of colors contained in the screen), * unitlength * * These functions have default implementations, see format.cc. * If the new format can use the default implementation, these * functions declarations should be removed. * std::string pic_header(const pair& sizes, const pair& offsets, const std::set& palette, const std::string& len) const; std::string pic_footer() const; */ // Print color declaration strings: model, name, densities std::string print_color(const std::string&, const std::string&, double, double, double) const; std::string print_color(const std::string&, const std::string&, double, double, double, double) const; // One-line comment std::string print_comment(const std::string&) const; // Verbatim output std::string print_verbatim(const std::string&) const; // begin and end a picture-like environment, set the unit length std::string start_picture(const pair&, const pair&) const; std::string end_picture() const; std::string set_unitlength(const std::string& len) const; // State data, if any, must be mutable void reset_state() const; private: mutable Color m_fill; mutable Color m_stroke; mutable length m_lwidth; std::string m_units; // override: inserted between path points std::string path_connector() const; std::string usepackages() const; // string argument for passing attributes local to this path/loop std::string start_open_path(const std::string&) const; std::string end_open_path(const std::string&) const; std::string start_closed_path(const std::string&) const; std::string end_closed_path(const std::string&) const; // print declarations to set state of output format std::string set_fill_state(const Color&) const; std::string set_pen_state(const pen_data&) const; // place a LaTeX box of width zero (containing string) at location (pair) std::string put_box(const pair&, const std::string&) const; std::string print_circle_marker(const pair& here, double diam, bool fill, const Color& color, const std::string& len) const; std::string print(const pair&) const; // override base class, print units }; // end of class tikz } // end of namespace #endif /* EPIX_TIKZ */ epix-1.2.22/glyph.cc0000644000175000017500000000725614167400347013207 0ustar hwanghwang/* * glyph.cc -- ePiX screen implemenation for labels and markers * * This file is part of ePiX, a C++ library for creating high-quality * figures in LaTeX * * Version 1.1.22 * Last Change: September 24, 2007 */ /* * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 * Andrew D. Hwang * Department of Mathematics and Computer Science * College of the Holy Cross * Worcester, MA, 01610-2395, USA */ /* * ePiX is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * ePiX is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public License * along with ePiX; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "constants.h" #include "angle_units.h" #include "functions.h" #include "pairs.h" #include "affine.h" #include "screen_mask.h" #include "length.h" #include "marker_style.h" #include "label_style.h" #include "format.h" #include "state.h" #include "picture_data.h" #include "picture.h" #include "glyph.h" namespace ePiX { glyph::glyph(const pair& here, const pair& offset, const std::string& label, const epix_mark_type mark, const marker_sizes& sizes, const label_state& style, const bool seen) : m_here(here), m_offset(offset), m_label(label), m_mark(mark), m_sizes(sizes), m_style(style), m_seen(seen) { } glyph& glyph::map_by(const affine& f) { m_here = f(m_here); // new location // map offset, preserving length const double old_norm(norm(m_offset)); m_offset = f(m_offset) - f(pair(0,0)); // new displacement const double new_norm(norm(m_offset)); if (EPIX_EPSILON < new_norm) m_offset *= old_norm/new_norm; // scale to preserve page length // compute new label angle; work in radians for safety/efficiency const double th(PI_180*m_style.label_angle()); // old angle in radians // new baseline direction const pair tmp_dir(f(pair(std::cos(th), std::sin(th))) - f(pair(0,0))); // no change if old baseline maps to zero if (EPIX_EPSILON < norm(tmp_dir)) { // new angle in current units double theta(Atan2(tmp_dir.x2(), tmp_dir.x1())); // effectively, reflect label; works well stylistically if (f.reverses_orientation()) theta -= 0.5*full_turn(); m_style.label_angle(theta); } return *this; } glyph& glyph::crop_to(const screen_mask& M) { if (M.crops(m_here)) m_seen = false; return *this; } glyph* glyph::clone() const { return new glyph(*this); } bool glyph::is_empty() const { return !m_seen; } std::string glyph::print_to(const format& fmt, const std::string& len) const { if (is_empty()) return ""; std::stringstream obuf; // print (masked) label, if any, before mark. if (m_label != "") obuf << fmt.print_text(m_here, m_offset, m_label, m_style, len); if (m_mark != TEXT && m_mark != PATH) obuf << fmt.print_mark(m_here, m_offset, m_mark, m_sizes, m_style, len); return obuf.str(); } void glyph::add_to_palette() const { the_picture().add_to_palette(m_style.text_color()) .add_to_palette(m_style.mask_color()) .add_to_palette(m_style.label_border().color()); } } // end of namespace epix-1.2.22/length.h0000644000175000017500000000666714167400347013214 0ustar hwanghwang/* * length.h -- ePiX true and LaTeX length manipulation * * This file is part of ePiX, a C++ library for creating high-quality * figures in LaTeX * * Version 1.2.0 * Last Change: September 22, 2007 */ /* * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 * Andrew D. Hwang * Department of Mathematics and Computer Science * College of the Holy Cross * Worcester, MA, 01610-2395, USA */ /* * ePiX is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * ePiX is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public License * along with ePiX; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * This file provides the length class from ePiX2: * * - length(std::string) assumes argument is "double [space(s)] unit" * Recognized units are pt (points), in, cm, mm, pc (picas = 1/12 in), * bp (big points = 1/72 in) * * Malformed strings are handled as follows: * Missing doubles are assumed to be 0, units are assumed to be pt * * - length(double) sets length to specified number of pt * * - operator += Increments a length, returning answer in LHS units, e.g. * 1cm+=2in is 6.08cm * 2in+=1cm is 2.3937in * * - operator *= scales a length by a double * - to(string) converts a length to specified units * - operator< compares true lengths * - get_lengths(string, length, length) parses a string into ht and width * * A length can be negative. */ #ifndef EPIX_LENGTH #define EPIX_LENGTH #include namespace ePiX { class length { public: length(std::string); // not const std::string& explicit length(double = 0); length& operator+= (const length&); // increment by another length length& operator*= (double); // scale length& to(std::string); // convert to specified units // compare, with units conversion bool operator== (const length&) const; bool operator!= (const length& len) const { return !((*this) == len); } // for output double magnitude() const; std::string units() const; std::string name() const; private: double m_mag; double pts_per_unit; // constants defined in length.cc std::string m_units; }; // end of class length // value-returning operators length operator+ (length, const length&); length operator* (double, length len); // Compare true size; must pass by value... bool operator< (length arg1, length arg2); /* * Parse a string into two lengths (width and height). * * The "sz" argument is expected to look like "4in x 10cm" or "4 x 6 in", * specifically a double, an optional two-letter unitlength, an "x", a * double, and a two-letter unitlength (defaults to pt). Spaces are * unimportant, as is initial or trailing garbage. Badly malformed input * (e.g., "4,6 in") may confuse the parsing code on some platforms. */ void get_lengths(std::string sz, length& length1, length& length2); } // end of namespace #endif /* EPIX_LENGTH */ epix-1.2.22/doc/0000755000175000017500000000000014235777646012327 5ustar hwanghwangepix-1.2.22/doc/pathstyle.xp0000644000175000017500000000071310646226343014677 0ustar hwanghwang/* -*-ePiX-*- */ #include "epix.h" using namespace ePiX; void dash_sample(double ht, std::string pattern) { line_style(pattern); line(P(0,ht), P(3,ht)); label(P(3, ht), P(4,0), "\\code{line\\_style(\""+pattern+"\")}", r); } int main() { picture(P(0,0), P(4,4), "4x1in"); begin(); dash_sample(4, "-\\ \\ -"); dash_sample(3, "-\\ \\ \\ \\ -"); dash_sample(2, " .\\ "); dash_sample(1, "-\\ .\\ -"); dash_sample(0, ".\\ - ."); end(); } epix-1.2.22/doc/alignment_lr.eepic0000644000175000017500000000104710643225006015764 0ustar hwanghwang%% Generated from alignment_lr.xp on Fri Jan 7 14:18:31 EST 2005 by %% ePiX-1.0.3 %% %% Cartesian bounding box: [-1,1] x [-1,1] %% Actual size: 72pt x 24pt %% Figure offset: right by 0pt, up by 0pt %% \setlength{\unitlength}{1pt} \begin{picture}(72,24)(-0,-0) %% --- \put(0,12){\makebox(0,0)[r]{\texttt{[l]}}} \put(0,12){\makebox(0,0)[c]{{\circle*{3}}}} \put(0,12){\makebox(0,0)[l]{\texttt{[r]}}} \put(72,12){\makebox(0,0)[b]{\texttt{[t]}}} \put(72,12){\makebox(0,0)[c]{{\circle*{3}}}} \put(72,12){\makebox(0,0)[t]{\texttt{[b]}}} \end{picture} epix-1.2.22/doc/cb.xp0000644000175000017500000000043610643225006013240 0ustar hwanghwang/* -*-ePiX-*- */ #include "epix.h" using namespace ePiX; int main() { bounding_box(P(-2,-1),P(2,1)); unitlength("1in"); picture(1.5,0.75); begin(); h_axis(4); v_axis(1); bold(); plot(cb, x_min, x_max, 4); label(P(0,y_min), P(0,-4), "\\code{cb}", b); end(); } epix-1.2.22/doc/koch.eepic0000644000175000017500000002423310643225006014237 0ustar hwanghwang%% Generated from koch.xp on Tue Jan 4 15:32:16 EST 2005 by %% ePiX-1.0.3 %% %% Cartesian bounding box: [0,3] x [0,0.5] %% Actual size: 3in x 0.5in %% Figure offset: right by 0in, up by 0.25in %% \setlength{\unitlength}{1in} \begin{picture}(3,0.5)(-0,-0.25) %% --- \path(0,0)(0.25,0)(0.25,0.25)(0.5,0.25)(0.5,0)(0.5,-0.25)(0.75,-0.25) (0.75,0)(1,0) %% --- \path(1,0)(1.0625,0)(1.0625,0.0625)(1.125,0.0625)(1.125,0)(1.125,-0.0625) (1.1875,-0.0625)(1.1875,0)(1.25,0)(1.25,0.0625)(1.1875,0.0625) (1.1875,0.125)(1.25,0.125)(1.3125,0.125)(1.3125,0.1875)(1.25,0.1875) (1.25,0.25)(1.3125,0.25)(1.3125,0.3125)(1.375,0.3125)(1.375,0.25) (1.375,0.1875)(1.4375,0.1875)(1.4375,0.25)(1.5,0.25)(1.5,0.1875) (1.5625,0.1875)(1.5625,0.125)(1.5,0.125)(1.4375,0.125)(1.4375,0.0625) (1.5,0.0625)(1.5,0)(1.5,-0.0625)(1.5625,-0.0625)(1.5625,-0.125) (1.5,-0.125)(1.4375,-0.125)(1.4375,-0.1875)(1.5,-0.1875)(1.5,-0.25) (1.5625,-0.25)(1.5625,-0.1875)(1.625,-0.1875)(1.625,-0.25)(1.625,-0.3125) (1.6875,-0.3125)(1.6875,-0.25)(1.75,-0.25)(1.75,-0.1875)(1.6875,-0.1875) (1.6875,-0.125)(1.75,-0.125)(1.8125,-0.125)(1.8125,-0.0625)(1.75,-0.0625) (1.75,0)(1.8125,0)(1.8125,0.0625)(1.875,0.0625)(1.875,0) \path(1.875,0)(1.875,-0.0625)(1.9375,-0.0625)(1.9375,0)(2,0) %% --- \path(2,0)(2.01562,0)(2.01562,0.015625)(2.03125,0.015625)(2.03125,0) (2.03125,-0.015625)(2.04688,-0.015625)(2.04688,0)(2.0625,0) (2.0625,0.015625)(2.04688,0.015625)(2.04688,0.03125)(2.0625,0.03125) (2.07812,0.03125)(2.07812,0.046875)(2.0625,0.046875)(2.0625,0.0625) (2.07812,0.0625)(2.07812,0.078125)(2.09375,0.078125)(2.09375,0.0625) (2.09375,0.046875)(2.10938,0.046875)(2.10938,0.0625)(2.125,0.0625) (2.125,0.046875)(2.14062,0.046875)(2.14062,0.03125)(2.125,0.03125) (2.10938,0.03125)(2.10938,0.015625)(2.125,0.015625)(2.125,0) (2.125,-0.015625)(2.14062,-0.015625)(2.14062,-0.03125)(2.125,-0.03125) (2.10938,-0.03125)(2.10938,-0.046875)(2.125,-0.046875)(2.125,-0.0625) (2.14062,-0.0625)(2.14062,-0.046875)(2.15625,-0.046875)(2.15625,-0.0625) (2.15625,-0.078125)(2.17188,-0.078125)(2.17188,-0.0625)(2.1875,-0.0625) (2.1875,-0.046875)(2.17188,-0.046875)(2.17188,-0.03125)(2.1875,-0.03125) (2.20312,-0.03125)(2.20312,-0.015625)(2.1875,-0.015625)(2.1875,0) (2.20312,0)(2.20312,0.015625)(2.21875,0.015625)(2.21875,0) \path(2.21875,0)(2.21875,-0.015625)(2.23438,-0.015625)(2.23438,0)(2.25,0) (2.25,0.015625)(2.23438,0.015625)(2.23438,0.03125)(2.25,0.03125) (2.26562,0.03125)(2.26562,0.046875)(2.25,0.046875)(2.25,0.0625) (2.23438,0.0625)(2.23438,0.046875)(2.21875,0.046875)(2.21875,0.0625) (2.21875,0.078125)(2.20312,0.078125)(2.20312,0.0625)(2.1875,0.0625) (2.1875,0.078125)(2.17188,0.078125)(2.17188,0.09375)(2.1875,0.09375) (2.20312,0.09375)(2.20312,0.109375)(2.1875,0.109375)(2.1875,0.125) (2.20312,0.125)(2.20312,0.140625)(2.21875,0.140625)(2.21875,0.125) (2.21875,0.109375)(2.23438,0.109375)(2.23438,0.125)(2.25,0.125) (2.26562,0.125)(2.26562,0.140625)(2.28125,0.140625)(2.28125,0.125) (2.28125,0.109375)(2.29688,0.109375)(2.29688,0.125)(2.3125,0.125) (2.3125,0.140625)(2.29688,0.140625)(2.29688,0.15625)(2.3125,0.15625) (2.32812,0.15625)(2.32812,0.171875)(2.3125,0.171875)(2.3125,0.1875) (2.29688,0.1875)(2.29688,0.171875)(2.28125,0.171875)(2.28125,0.1875) (2.28125,0.203125)(2.26562,0.203125)(2.26562,0.1875) \path(2.26562,0.1875)(2.25,0.1875)(2.25,0.203125)(2.23438,0.203125) (2.23438,0.21875)(2.25,0.21875)(2.26562,0.21875)(2.26562,0.234375) (2.25,0.234375)(2.25,0.25)(2.26562,0.25)(2.26562,0.265625) (2.28125,0.265625)(2.28125,0.25)(2.28125,0.234375)(2.29688,0.234375) (2.29688,0.25)(2.3125,0.25)(2.3125,0.265625)(2.29688,0.265625) (2.29688,0.28125)(2.3125,0.28125)(2.32812,0.28125)(2.32812,0.296875) (2.3125,0.296875)(2.3125,0.3125)(2.32812,0.3125)(2.32812,0.328125) (2.34375,0.328125)(2.34375,0.3125)(2.34375,0.296875)(2.35938,0.296875) (2.35938,0.3125)(2.375,0.3125)(2.375,0.296875)(2.39062,0.296875) (2.39062,0.28125)(2.375,0.28125)(2.35938,0.28125)(2.35938,0.265625) (2.375,0.265625)(2.375,0.25)(2.375,0.234375)(2.39062,0.234375) (2.39062,0.21875)(2.375,0.21875)(2.35938,0.21875)(2.35938,0.203125) (2.375,0.203125)(2.375,0.1875)(2.39062,0.1875)(2.39062,0.203125) (2.40625,0.203125)(2.40625,0.1875)(2.40625,0.171875)(2.42188,0.171875) (2.42188,0.1875)(2.4375,0.1875)(2.4375,0.203125)(2.42188,0.203125) \path(2.42188,0.203125)(2.42188,0.21875)(2.4375,0.21875)(2.45312,0.21875) (2.45312,0.234375)(2.4375,0.234375)(2.4375,0.25)(2.45312,0.25) (2.45312,0.265625)(2.46875,0.265625)(2.46875,0.25)(2.46875,0.234375) (2.48438,0.234375)(2.48438,0.25)(2.5,0.25)(2.5,0.234375) (2.51562,0.234375)(2.51562,0.21875)(2.5,0.21875)(2.48438,0.21875) (2.48438,0.203125)(2.5,0.203125)(2.5,0.1875)(2.51562,0.1875) (2.51562,0.203125)(2.53125,0.203125)(2.53125,0.1875)(2.53125,0.171875) (2.54688,0.171875)(2.54688,0.1875)(2.5625,0.1875)(2.5625,0.171875) (2.57812,0.171875)(2.57812,0.15625)(2.5625,0.15625)(2.54688,0.15625) (2.54688,0.140625)(2.5625,0.140625)(2.5625,0.125)(2.54688,0.125) (2.54688,0.109375)(2.53125,0.109375)(2.53125,0.125)(2.53125,0.140625) (2.51562,0.140625)(2.51562,0.125)(2.5,0.125)(2.48438,0.125) (2.48438,0.109375)(2.46875,0.109375)(2.46875,0.125)(2.46875,0.140625) (2.45312,0.140625)(2.45312,0.125)(2.4375,0.125)(2.4375,0.109375) (2.45312,0.109375)(2.45312,0.09375)(2.4375,0.09375)(2.42188,0.09375) \path(2.42188,0.09375)(2.42188,0.078125)(2.4375,0.078125)(2.4375,0.0625) (2.45312,0.0625)(2.45312,0.078125)(2.46875,0.078125)(2.46875,0.0625) (2.46875,0.046875)(2.48438,0.046875)(2.48438,0.0625)(2.5,0.0625) (2.5,0.046875)(2.51562,0.046875)(2.51562,0.03125)(2.5,0.03125) (2.48438,0.03125)(2.48438,0.015625)(2.5,0.015625)(2.5,0)(2.5,-0.015625) (2.51562,-0.015625)(2.51562,-0.03125)(2.5,-0.03125)(2.48438,-0.03125) (2.48438,-0.046875)(2.5,-0.046875)(2.5,-0.0625)(2.51562,-0.0625) (2.51562,-0.046875)(2.53125,-0.046875)(2.53125,-0.0625) (2.53125,-0.078125)(2.54688,-0.078125)(2.54688,-0.0625)(2.5625,-0.0625) (2.5625,-0.078125)(2.57812,-0.078125)(2.57812,-0.09375)(2.5625,-0.09375) (2.54688,-0.09375)(2.54688,-0.109375)(2.5625,-0.109375)(2.5625,-0.125) (2.54688,-0.125)(2.54688,-0.140625)(2.53125,-0.140625)(2.53125,-0.125) (2.53125,-0.109375)(2.51562,-0.109375)(2.51562,-0.125)(2.5,-0.125) (2.48438,-0.125)(2.48438,-0.140625)(2.46875,-0.140625)(2.46875,-0.125) (2.46875,-0.109375)(2.45312,-0.109375)(2.45312,-0.125)(2.4375,-0.125) \path(2.4375,-0.125)(2.4375,-0.140625)(2.45312,-0.140625)(2.45312,-0.15625) (2.4375,-0.15625)(2.42188,-0.15625)(2.42188,-0.171875)(2.4375,-0.171875) (2.4375,-0.1875)(2.45312,-0.1875)(2.45312,-0.171875)(2.46875,-0.171875) (2.46875,-0.1875)(2.46875,-0.203125)(2.48438,-0.203125)(2.48438,-0.1875) (2.5,-0.1875)(2.5,-0.203125)(2.51562,-0.203125)(2.51562,-0.21875) (2.5,-0.21875)(2.48438,-0.21875)(2.48438,-0.234375)(2.5,-0.234375) (2.5,-0.25)(2.51562,-0.25)(2.51562,-0.234375)(2.53125,-0.234375) (2.53125,-0.25)(2.53125,-0.265625)(2.54688,-0.265625)(2.54688,-0.25) (2.5625,-0.25)(2.5625,-0.234375)(2.54688,-0.234375)(2.54688,-0.21875) (2.5625,-0.21875)(2.57812,-0.21875)(2.57812,-0.203125)(2.5625,-0.203125) (2.5625,-0.1875)(2.57812,-0.1875)(2.57812,-0.171875)(2.59375,-0.171875) (2.59375,-0.1875)(2.59375,-0.203125)(2.60938,-0.203125)(2.60938,-0.1875) (2.625,-0.1875)(2.625,-0.203125)(2.64062,-0.203125)(2.64062,-0.21875) (2.625,-0.21875)(2.60938,-0.21875)(2.60938,-0.234375)(2.625,-0.234375) (2.625,-0.25)(2.625,-0.265625)(2.64062,-0.265625)(2.64062,-0.28125) \path(2.64062,-0.28125)(2.625,-0.28125)(2.60938,-0.28125) (2.60938,-0.296875)(2.625,-0.296875)(2.625,-0.3125)(2.64062,-0.3125) (2.64062,-0.296875)(2.65625,-0.296875)(2.65625,-0.3125) (2.65625,-0.328125)(2.67188,-0.328125)(2.67188,-0.3125)(2.6875,-0.3125) (2.6875,-0.296875)(2.67188,-0.296875)(2.67188,-0.28125)(2.6875,-0.28125) (2.70312,-0.28125)(2.70312,-0.265625)(2.6875,-0.265625)(2.6875,-0.25) (2.70312,-0.25)(2.70312,-0.234375)(2.71875,-0.234375)(2.71875,-0.25) (2.71875,-0.265625)(2.73438,-0.265625)(2.73438,-0.25)(2.75,-0.25) (2.75,-0.234375)(2.73438,-0.234375)(2.73438,-0.21875)(2.75,-0.21875) (2.76562,-0.21875)(2.76562,-0.203125)(2.75,-0.203125)(2.75,-0.1875) (2.73438,-0.1875)(2.73438,-0.203125)(2.71875,-0.203125)(2.71875,-0.1875) (2.71875,-0.171875)(2.70312,-0.171875)(2.70312,-0.1875)(2.6875,-0.1875) (2.6875,-0.171875)(2.67188,-0.171875)(2.67188,-0.15625)(2.6875,-0.15625) (2.70312,-0.15625)(2.70312,-0.140625)(2.6875,-0.140625)(2.6875,-0.125) (2.70312,-0.125)(2.70312,-0.109375)(2.71875,-0.109375)(2.71875,-0.125) (2.71875,-0.140625)(2.73438,-0.140625) \path(2.73438,-0.140625)(2.73438,-0.125)(2.75,-0.125)(2.76562,-0.125) (2.76562,-0.109375)(2.78125,-0.109375)(2.78125,-0.125)(2.78125,-0.140625) (2.79688,-0.140625)(2.79688,-0.125)(2.8125,-0.125)(2.8125,-0.109375) (2.79688,-0.109375)(2.79688,-0.09375)(2.8125,-0.09375)(2.82812,-0.09375) (2.82812,-0.078125)(2.8125,-0.078125)(2.8125,-0.0625)(2.79688,-0.0625) (2.79688,-0.078125)(2.78125,-0.078125)(2.78125,-0.0625) (2.78125,-0.046875)(2.76562,-0.046875)(2.76562,-0.0625)(2.75,-0.0625) (2.75,-0.046875)(2.73438,-0.046875)(2.73438,-0.03125)(2.75,-0.03125) (2.76562,-0.03125)(2.76562,-0.015625)(2.75,-0.015625)(2.75,0)(2.76562,0) (2.76562,0.015625)(2.78125,0.015625)(2.78125,0)(2.78125,-0.015625) (2.79688,-0.015625)(2.79688,0)(2.8125,0)(2.8125,0.015625) (2.79688,0.015625)(2.79688,0.03125)(2.8125,0.03125)(2.82812,0.03125) (2.82812,0.046875)(2.8125,0.046875)(2.8125,0.0625)(2.82812,0.0625) (2.82812,0.078125)(2.84375,0.078125)(2.84375,0.0625)(2.84375,0.046875) (2.85938,0.046875)(2.85938,0.0625)(2.875,0.0625)(2.875,0.046875) \path(2.875,0.046875)(2.89062,0.046875)(2.89062,0.03125)(2.875,0.03125) (2.85938,0.03125)(2.85938,0.015625)(2.875,0.015625)(2.875,0) (2.875,-0.015625)(2.89062,-0.015625)(2.89062,-0.03125)(2.875,-0.03125) (2.85938,-0.03125)(2.85938,-0.046875)(2.875,-0.046875)(2.875,-0.0625) (2.89062,-0.0625)(2.89062,-0.046875)(2.90625,-0.046875)(2.90625,-0.0625) (2.90625,-0.078125)(2.92188,-0.078125)(2.92188,-0.0625)(2.9375,-0.0625) (2.9375,-0.046875)(2.92188,-0.046875)(2.92188,-0.03125)(2.9375,-0.03125) (2.95312,-0.03125)(2.95312,-0.015625)(2.9375,-0.015625)(2.9375,0) (2.95312,0)(2.95312,0.015625)(2.96875,0.015625)(2.96875,0) (2.96875,-0.015625)(2.98438,-0.015625)(2.98438,0)(3,0) %% --- \end{picture} epix-1.2.22/doc/objects.xp0000644000175000017500000000113410643225006014301 0ustar hwanghwang/* -*-ePiX-*- */ #include "epix.h" using namespace ePiX; int main() { picture(P(0,0), P(5,2), "3.75 x 1.5in"); begin(); // roof triangle(P(0.9, 1), P(3.1, 1), P(2, 1.5)); // vertices // sun circle(P(4,1.5), 0.25); // center and radius // house rect(P(1,0), P(3,1)); // opposite corners // grid(P(1,0), P(3,1), 1, 10); // corners, numbers of subdivisions // door fill(Black(0.1)); rect(P(2.3,0), P(2.7,0.8)); // corners fill(White()); // window rect(P(1.4,0.2), P(2, 0.6)); bold(); grid(P(1.4,0.2), P(2, 0.6), 2, 2); line(P(xmin(),0), P(xmax(),0)); end(); } epix-1.2.22/doc/hello.eepic0000644000175000017500000000064110643225006014413 0ustar hwanghwang%% Generated from hello.xp on Thu Jun 28 11:33:40 EDT 2007 by %% ePiX-1.1.6 %% %% Cartesian bounding box: [-1,1] x [-1,1] %% Actual size: 2 x 1in %% Figure offset: left by 0in, down by 0in %% \xdefinecolor{rgb_000000}{rgb}{0,0,0} \setlength{\unitlength}{1in} \begin{picture}(2,1)(-0,-0) \put(1,0.5){\makebox(0,0)[c]{{\Huge Hello, world!}}} \allinethickness{1pt}% \path(2,0)(2,1)(0,1)(0,0)(2,0) %% \end{picture} epix-1.2.22/doc/epix.info0000644000175000017500000067636413157527116014162 0ustar hwanghwangThis is epix.info, produced by makeinfo version 5.2 from epix.texi. This is the manual for ePiX, Version 1.2 Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2017 Andrew D. Hwang INFO-DIR-SECTION TeX START-INFO-DIR-ENTRY * ePiX: (epix). Drawing mathematically accurate figures. END-INFO-DIR-ENTRY  File: epix.info, Node: Top, Next: Introduction, Up: (dir) ePiX manual *********** This is the manual for ePiX, Version 1.2 Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2017 Andrew D. Hwang * Menu: * Introduction :: * Getting Started :: * Reference Manual :: * Advanced Topics :: * Software Freedom:: * Acknowledgments:: * Function Index:: * Concept Index:: -- The Detailed Node Listing -- Introduction * Software Dependencies:: * Installation:: Software Dependencies * Setting up an Environment Under Windows:: Installation * Development:: Getting Started * Running 'ePiX':: * The Drawing Model:: * Tutorial:: * 'C++' Basics:: * Animation:: * Layout Tricks:: 'C++' Basics * File Format:: * Variables and Functions:: * Comments:: * Program Execution:: * Strings and Raw Output:: * Conditionals and Loops:: Layout Tricks * Stereograms:: * Inset Images:: Reference Manual * File Structure:: * Picture Size and Aspect Ratio:: * Color:: * Scene Attributes:: * Drawing Attributes:: * Creating and Drawing Objects:: * More About 'C++':: * Attribute Quick Reference:: Color * Constructors:: * Color Operations:: Scene Attributes * Angular Mode:: * The Camera:: * Clipping:: * Screens and Page Layout:: Drawing Attributes * Filled Regions:: * Paths:: * Text Objects:: * Color Declarations:: Creating and Drawing Objects * Geometric Data Structures:: * Path-Like Elements:: * Coordinate Axes and Labels:: * The Path Class:: * Function Plotting:: * Calculus Plotting:: * Non-Euclidean Geometry:: * Data Plotting:: * Legends:: More About 'C++' * Names and Types:: * Functions:: * Mathematical Functions:: * Basics of Classes:: * References and Function Arguments:: * Overloading:: * Scope:: * Headers and Pre-Processing:: * Comparison with 'LaTeX' Syntax:: Advanced Topics * Hidden Object Removal:: * Extensions:: * Programmer's Guide:: Extensions * Header Files:: * Compiling:: * Runtime Linking:: * Using Multiple Versions:: Programmer's Guide * External Packages:: * User Interface:: * Implementation Classes::  File: epix.info, Node: Introduction, Next: Getting Started, Prev: Top, Up: Top 1 Introduction ************** 'ePiX', a collection of batch utilities, creates mathematically accurate figures, plots, and animations containing 'LaTeX' typography. The input syntax is easy to learn, and the user interface resembles that of 'LaTeX' itself: You prepare a scene description in a text editor, then "compile" the input file into a picture. 'LaTeX'- and web-compatible output types include a 'LaTeX' picture-like environment written with 'PSTricks', 'tikz', or 'eepic' macros; vector images ('eps', 'ps', and 'pdf'); and bitmapped images and movies ('png', 'mng', and 'gif'). 'ePiX''s strengths include: * Quality of output: 'ePiX' creates accurate, publication-quality figures whose appearance matches that of 'LaTeX'. Typography may be put in a figure as easily as in an ordinary 'LaTeX' document. * Ease of use: Figure objects and their attributes are specified by simple, descriptive commands. * Flexibility: Objects are described by attributes and Cartesian location; as in 'LaTeX', printed appearance is determined when the figure is compiled. A well-designed figure can be altered dramatically, yet precisely, with command-line switches or minor changes to the input file. * Power and extendibility: 'ePiX' inherits the power of 'C++' as a programming language; variables, data structures, loops, and recursion can be used to draw complicated plots and figures with just a few lines of input. External code can be incorporated in a figure with a command line option or by using a Makefile. * Economy of storage and transmission: For a document containing many figures, a compressed tar file of the 'LaTeX' sources and 'ePiX' files is typically a few percent the size of the compressed PostScript file. * License: 'ePiX' is _free software_. You are granted the right to use the program for whatever purpose, and to inspect, modify, and re-distribute the source code, so long as you do not restrict the rights of others to do the same. In short, the license is similar to the terms under which theorems are published. 'ePiX' facilitates logical structuring of mathematical figures, as opposed to visual structuring (or WYSIWYG), analogous to the relationship between 'LaTeX' and a word processor. Stylistic defaults streamline the creation of simple figures, but there are few internal restrictions on the contents or appearance of a figure; aesthetic and practical decisions are left to you. If you are a: * Potential user, you may wish to skip immediately to "Software Dependencies" before investing additional time. * New user, proceed from here until you have enough understanding to run the software, then experiment with the samples files while reading Chapter *Note chapter-started::, , or return to the manual as needed. * More advanced user, browse at will, probably starting with Chapter *Note chapter-ref-man::, . This manual is relatively conversational, and occasionally redundant, especially between portions meant for readers at different levels of familiarity. Throughout, you are assumed to be familiar with 'LaTeX' and basic linear algebra: the description of points, vectors, lines, and planes in three-dimensional space. Other material, such as 'C++' syntax, is introduced as needed. * Menu: * Software Dependencies:: * Installation::  File: epix.info, Node: Software Dependencies, Next: Installation, Up: Introduction 1.1 Software Dependencies ========================= If you run GNU/Linux, a BSD, or Solaris, you probably have (and can surely install) all the external software needed to use 'ePiX'. On Mac OS X, you will need the Apple developer tools and an X server (such as XQuartz), and the free 'fink' package manager to build a GNU environment. For Windows, you'll need to install Cygwin and several packages. Detailed instructions are given below. "Under the hood", an input file is successively converted to a 'LaTeX' picture; 'dvi'; PostScript, 'pdf' or 'eps'; and if desired, to a bitmapped image or movie. Four shell scripts--'epix', 'laps', 'elaps', and 'flix'--automate the various file format conversions. 'ePiX' consists of a 'C++' library, header, and shell scripts, and requires GNU 'bash' and a compiler _for normal use_. For complete functionality, you need 'g++' (Version 3.2 or later), 'bash', a text editor ('ePiX' works particularly well with 'emacs'), a 'LaTeX' distribution, 'Ghostscript', 'gv' (or your favorite PS/PDF previewer), and 'GraphicsMagick'. GNU 'grep' and 'sed' are good to have. You may need additional "developer packages" ('binutils', 'make') in order to build 'ePiX'. The more up to date your software is, the better your experience is likely to be, but bleeding edge versions are not necessary, or even always desirable. Aside from their reliance on specific programs, 'ePiX''s shell scripts are written using Unix-style pathnames. Thus, the most straightforward way to use 'ePiX' is to install a GNU environment. Jay Belanger's 'emacs' mode allows you to write, compile, and view 'ePiX' figures without leaving 'emacs'. If you use another editor, you'll want to create template source files so you don't have to type boilerplate code each time you write a new figure. * Menu: * Setting up an Environment Under Windows::  File: epix.info, Node: Setting up an Environment Under Windows, Up: Software Dependencies 1.1.1 Setting up an Environment Under Windows --------------------------------------------- Cygwin can be used to run 'ePiX' under Windows. Download 'setup.exe' from , then install the packages you need. The following are recommended, and sufficient for the actions described in this manual. (Archive) bzip2, tar (Devel) binutils, coreutils, gcc, gcc-g++, make, sed (Editors) emacs, emacs-X11, vim (Graphics) GraphicsMagick, ghostscript-base, ghostscript-x11, gv (Publishing) tetex (all) (Shells) bash, bash-completion (X11) X-start-menu-icons, X-startup-scripts, XFree86-lib-compat, xorg-x11-fscl, xorg-x11-fsrv  File: epix.info, Node: Installation, Prev: Software Dependencies, Up: Introduction 1.2 Installation ================ 'ePiX' is distributed over the World-Wide Web as source code. Packages may be found at The latest stable release is also on the CTAN mirrors, in the 'graphics' directory. (Some users of Red Hat have reported file permission problems when unpacking the CTAN tarballs. If you encounter this difficulty, please try downloading the sources from the project main page.) Unpack the compressed tar file with the appropriate command: tar -zxvf epix-x.y.z.tar.gz tar -jxvf epix-x.y.z.tar.bz2 ('x.y.z' is the version number) or, if your 'tar' doesn't do decompression, gunzip -c epix-x.y.z.tar.gz | tar -xvf - bzcat epix-x.y.z.tar.bz2 | tar -xvf - 'cd' to the source directory, 'epix-x.y.z'. The 'INSTALL' file contains detailed installation instructions. If you're impatient, the short of it is './configure [--options]; make; make install'. Run './configure --help' for a list of options. By default, 'ePiX' installs in subdirectories of '/usr/local'; if you want to install elsewhere, supply './configure' with the appropriate '--prefix'. You may also want to consult 'POST-INSTALL' for information on setting your 'PATH' variable so your shell can find 'ePiX'. The manual and sample files are in '/usr/local/share/doc/epix'. * Menu: * Development::  File: epix.info, Node: Development, Up: Installation 1.2.1 Development ----------------- There are two mailing lists, one for user questions, one for development discussion. Please visit to subscribe.  File: epix.info, Node: Getting Started, Next: Reference Manual, Prev: Introduction, Up: Top 2 Getting Started ***************** This chapter describes the basics of creating figures in 'ePiX' for readers familiar with 'LaTeX' but completely new to 'C++'. No detailed knowledge of 'C++' is needed to use 'ePiX', only a bit of grammar that is easily absorbed by example. Section *Note section-running::, describes the commands (shell scripts) comprising 'ePiX', and explains how to set up a graphical environment using standard *nix programs. Section *Note section-overview::, briefly describes figure creation. Section *Note section-tutorial::, presents a few files side-by-side with their output, and should be read at a computer so you can run the exercises. * Menu: * Running 'ePiX':: * The Drawing Model:: * Tutorial:: * 'C++' Basics:: * Animation:: * Layout Tricks::  File: epix.info, Node: Running 'ePiX', Next: The Drawing Model, Up: Getting Started 2.1 Running 'ePiX' ================== An "input file" is a human-written figure specification containing 'ePiX' commands; an "output file" is either a 'LaTeX' picture-like environment or a stand-alone vector graphic. Conversion ("compiling" a figure) is accomplished with four shell scripts, 'laps', 'epix', 'elaps', and 'flix'. Each script has a preferred extension for its input files, and is invoked with a command of the form