From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/573 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Circuit diagrams Date: Tue, 22 Jun 1999 00:02:10 +0200 Sender: owner-ntg-context@let.uu.nl Message-ID: <376EB662.36594B1B@wxs.nl> References: <3.0.5.32.19990620114648.00a8e4c0@mail.northcoast.com> <3.0.5.32.19990621095557.00a972b0@mail.northcoast.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035391425 25204 80.91.224.250 (23 Oct 2002 16:43:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 16:43:45 +0000 (UTC) Original-To: David Arnold Xref: main.gmane.org gmane.comp.tex.context:573 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:573 David Arnold wrote: > > Hans, > > Interesting. How would you draw a mass hanging on a spring in Metapost? > Have you done this before? Sample code? Run the next mp file and take a look in GSview (nb, even fig numbers). It need a bit cleaning up, but it's not that hard. When I find some idle moment, I'll see if I can work it out as an example for the manual. input mp-tool ; def animate (expr weight, spring, position) = h := spring ; w := h/8 ; pickup pencircle scaled 2.5 ; fill fullcircle scaled weight shifted (0,-.5weight) withcolor .7white ; draw (( 0, 0)--( 0, 20)-- (-w, 30)--(+w, 40)-- (-w, 50)--(+w, 60)-- (-w, 70)--(+w, 80)-- (-w, 90)--( 0,100)-- ( 0,110)) xscaled position ; pickup pencircle scaled 5 ; drawdot (0,0) ; enddef ; for i=.2 step .2 until 1 : beginfig(i*10) ; animate (40,100,i) ; endfig ; endfor ; end . ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl -----------------------------------------------------------------