This is plxytx.c in view mode; [Download] [Up]
/* Prints out text along a sloping axis joining world coordinates */ /* (wx1,wy1) to (wx2,wy2). Parameters are as for plmtext */ #include "plplot.h" #include <math.h> void plxytx(wx1,wy1,wx2,wy2,disp,pos,just,text) double wx1,wy1,wx2,wy2,disp,pos,just; char *text; { int refx, refy; double shift, cc, ss, def, ht; double xform[4], diag; double xscl, xoff, yscl, yoff, wx, wy; gchr(&def,&ht); gwm(&xscl,&xoff,&yscl,&yoff); cc = xscl * (wx2-wx1); ss = yscl * (wy2-wy1); diag = sqrt(cc*cc + ss*ss); cc = cc/diag; ss = ss/diag; xform[0] = cc; xform[1] = 0.0; xform[2] = ss; xform[3] = 1.0; shift = 0.0; if (just != 0.0) shift = plstrl(text) * just; wx = wx1 + pos * (wx2 - wx1); wy = wy1 + pos * (wy2 - wy1); refx = mmpcx(wcmmx(wx) - shift * cc); refy = mmpcy(wcmmy(wy) - shift * ss - disp * ht); plstr(0,xform,refx,refy,text); }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.