From: W. Trevor King Date: Wed, 11 Apr 2012 20:53:05 +0000 (-0400) Subject: Strip trailing whitespace from Mechanics.asy. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4b50babb40f0e5ddd4ce29dcb0cdadef60cd51ba;p=course.git Strip trailing whitespace from Mechanics.asy. --- diff --git a/asymptote/Mechanics.asy b/asymptote/Mechanics.asy index 8cdfbee..9eacce6 100644 --- a/asymptote/Mechanics.asy +++ b/asymptote/Mechanics.asy @@ -68,14 +68,14 @@ struct LabeledCircle { struct Mass { LabeledCircle lc; real m; - + void operator init(pair center=(0,0), real m=1, real radius=2mm, pen outline=currentpen, pen fill=grey, Label L="") { this.lc.operator init(center=center, radius=radius, outline=outline, fill=fill, L=L); this.m = m; } - + pair center() { return this.lc.center; } void set_center(pair center) { this.lc.center = center; } void draw(picture pic=currentpicture) = this.lc.draw; @@ -90,7 +90,7 @@ struct Block { pen outline; pen fill; Label L; - + void operator init(pair center=(0,0), real m=1, real width=5mm, real height=-1, real direction=0, pen outline=currentpen, pen fill=grey, Label L="") { this.center = center; this.m = m; @@ -104,7 +104,7 @@ struct Block { this.fill = fill; this.L = L; } - + void draw(picture pic=currentpicture) { picture picF; path c = rotate(direction)*scale(width,height)*shift(-.5,-.5)*unitsquare; @@ -322,7 +322,7 @@ struct Distance { real scale; pen outline; Label label; - + void operator init(pair pFrom=(0,0), pair pTo=(5mm,0), real offset=0, real scale=5mm, pen outline=currentpen, Label L="") { this.pFrom = pFrom; this.pTo = pTo; @@ -363,11 +363,11 @@ struct Angle { this.fill = fill; this.label = L; } - + void draw(picture pic=currentpicture) { picture picF; bool direction; - + real ccw_angle = degrees(C-A)-degrees(B-A); bool direction = CCW; if (ccw_angle < 0) ccw_angle += 360.0; @@ -449,7 +449,7 @@ struct Surface { pen filla; pen fillb; Label L; - + void operator init(pair pFrom=(0,0), pair pTo=(5mm,0), real thickness=5mm, pen outline=currentpen, pen filla=rgb(.5,.5,.5), pen fillb=rgb(.7,.7,.7), Label L="") { this.pFrom = pFrom; this.pTo = pTo; @@ -459,7 +459,7 @@ struct Surface { this.fillb = fillb; this.L = L; } - + void draw(picture pic=currentpicture, bool rotateLabel=true) { picture picF; picture picL; @@ -492,7 +492,7 @@ struct Spring { int nLoops; pen outline; Label L; - + void operator init(pair pFrom=(0,0), pair pTo=(5mm,0), real k=1, real width=3mm, real dLength=1mm, real deadLength=3mm, real unstretchedLength=12mm, pen outline=currentpen, Label L="") { this.pFrom = pFrom; this.pTo = pTo; @@ -508,14 +508,14 @@ struct Spring { this.nLoops = 1; this.deadLength = (unstretchedLength-this.nLoops*dLength)/2; } - + void draw(picture pic=currentpicture, bool rotateLabel=true) { picture picF; picture picL; label(picL, L); pair pLabelSize = 1.2 * (max(picL)-min(picL)); pair pDiff = pTo - pFrom; - + real working_dLength = (length(pDiff) - 2*deadLength) / nLoops; path p = (0,0)--(deadLength,0); path loop = (0,0) @@ -530,7 +530,7 @@ struct Spring { loopStart = point(p, length(p)); p = p--(loopStart+(deadLength,0)); p = rotate(degrees(pDiff)) * p; - + pair label_rotate=pDiff; if (rotateLabel == false) label_rotate=(1,0);