das1404

135 Reputation

6 Badges

12 years, 53 days

MaplePrimes Activity


These are questions asked by das1404

The program below is of two circles in the design of a simple ear-ring: baasically a large circle with a circle of varying radius removed.  I have tried to display the animation with the position of the centreof mass, but the animation is too fast and "jittery".  I'd like to slow the animation down to better see if my calculations are correct.  Is there some way of doing this, other than the Animation/Slower/Faster keys?.

 

restart:

# # # # # # # # # # # # # # # # # # # # # # # # # # # #

# Earing Two circles

# A small circle (sc) of radius r, is drawn inside and tangential to

# a bigger circle,(bc), of radius R.  The origin (0,0) is at the bottom of

# the big circle. The small circle is removed to obatain a shape in the

# form of an earing.  x_bar is the distance from the origin of the

# centroid.

# When the centroid is on the circumference of the small circle then the

# ratio R/r = the golden ratio 1.645(?)

# # # # # # # # # # # # # # # # # # # # # # # # # # # #

with(plots):

with(plottools):

Digits:=4:

R:=20:

#r:=10:

#circles

#sc := disk([0,2*R-r], r, color=white):  #in for loop

bc := disk([0,R], R, color=red):

 

for r from 1 by 1 to R do

  x_bar:=eval((R^2+R*r-r^2)/(R+r)):

printf("x_bar =%4.2f   R/r =%5.3f\n", x_bar, R/r);

  sc[r] := disk([0,2*R-r], r, color=white):

  Pt[r]:=point([0,x_bar],color=black):

#plots[display](sc,bc, scaling =constrained);

#t1[r]:=textplot([4*R/3,4*R/3,cat("xbar",convert(x_bar, string))]):

Rat:=R/r:

t1[r]:=textplot([4*R/3,4*R/3,convert(x_bar, float)]):   t2[r]:=textplot([2*R,4*R/3,convert(Rat, float)] ):

 

  p[r]:= plots[display](Pt[r],sc[r],t1[r],t2[r],bc ):       

end do:
 

#for loop to give individual images

#for r from 1 to R do
 

plots[display]({seq(p[r], r=1..R)}, scaling=constrained,axes=none,insequence=true);


#animate({seq(p[r], r=1..R)},t=1..4, scaling=constrained,axes=none);  #,frames=50);

#plots[display]({p[r]},scaling=constrained,axes=none,insequence=true);

#end do;

The program below is a high school problem, related to the area a horse can graze, given it is tethered to a rectangular barn.  The level of difficulty is related to the length of rope.  

   I wanted to display some graphics of the field, barn and tethered horse - this latter being the most difficult.  I experimented with a .png picture of a plain silouhette of a horse, imported this into Photoshop, then saved it as a .pdf file, importing this into Maple,  I managed to import this into the worksheet, but I wanted a scaled down version of the horse in the program plots[display] section.  I was unsuccessful in this.  Undeterred, I decided to try and draw a version of a horse using the plots/plottools packages.  The resulting "horse" looks more like a cat, warthog,  mouse or chameleon! 

   I understand later versions of Maple are able to import graphic images.   I'd appreciate some feedback as to how easy this is, and the quality of the resulting images in Maple output.

Thanks,

    David  .  .    

 

restart:

# # # # # # # # # # # # # # # # # # # # # # # # # # # #

# Horse tethered to barn - what area of grass?

# # # # # # # # # # # # # # # # # # # # # # # # # # # #

with(plots):

with(plottools):

macro(palegreen=COLOR(RGB, .5607, .9372, .5607)):

col1:=`black`:

print(`A horse is tethered to the corner of a barn, 10 m wide and 20 m long.  Find the area`);

print(`the horse can graze, if the length of rope is:`);

print(` i.)   5 m   ii.)  25 m  amd iii.)  50 m`);

#Length of rope

L:=10:

#Dims of barn

len:=20:wid:=10:

#Position of bottom left corner of barn

x_barn:=50:y_barn:=50:

len:=20:wid:=10:

 

#dimensions of field

flen:=120:fwid:=110:

 

rect_barn:=rectangle([x_barn,wid+y_barn], [len+x_barn,y_barn], color=brown):

rect_field:=rectangle([0,fwid], [flen,0], color=palegreen):

 

#Position of horse

x0:=37:y0:=32:

a := 4: b := 2.5:

belli := ellipse([x0,y0], a, b, filled=true, color=col1):

legf:=line([x0-1,y0-2], [x0-2,y0-6], color=col1, linestyle=1, thickness=1):

legf2:=line([x0-2,y0-2], [x0-3,y0-6], color=col1, linestyle=1, thickness=2):

rleg:=line([x0+1,y0-2], [x0+2,y0-6], color=col1, linestyle=1, thickness=2):

 

rleg2:=line([x0+2,y0-2], [x0+3,y0-6], color=col1, linestyle=1, thickness=2):

head := polygon([[x0-6,y0+3],[x0-5,y0+4], [x0-2,y0+5], [x0-3,y0+2]], color=brown, linestyle=3, thickness=2):

tail:=line([x0+6,y0-4], [x0+4,y0+1], color=col1, linestyle=1,thickness=2):

 

a := arc([x0+13,y0+3], 15, Pi/2..Pi+.1, color=blue):

plots[display](a,tail,head,belli,legf,legf2,rleg,rleg2,rect_barn,rect_field, scaling=constrained, axes=none);

I ran the short program below in trying to understand how the read statement works.  The read statement output the expected values of a, b, c to the screen.  I was curious to find where it had stored the file named 'tempor', so inspected my hard drive in the directory where the program was stored - to find it wasn't there.  I then commented the a, b, c statements and the save command so the program is now as in the second version below:

 

 restart:

a:=2:b:=3:c:=4:

save a, b, c, "tempor";

read tempor;

eval(a);

 

  I ran this program, expecting an error message, but it gave me the same output as before.   I again unsuccessfully searched for the file.   I then turned the computer off after saving the program, rebooted and ran thhe same program below.  It output the same values as before.  I'm thinking that Maple creates a special file, and appends it to the program, something like a table.  I'm not quite sure how this would be used, as opposed to just stating te values of a, b,c in the program.

   Any advice or comments gratefully received.

David 

 

restart:

#a:=2:b:=3:c:=4:

#save a, b, c, "tempor";

read tempor;

eval(a);

The program below is meant to use the  solve command to find the sides a, b, c of a triangle, given the lengths of the three altitudes, hA, hB and hC.  This program came from a higher version of Maple and I wondered what the word 'explicit' is meant to do in the  Sol->[solve({hA=(...statement.  The output just gives the name Sol - when I would have liked it to either give a solution for the sides in terms of the altitudes hA,hB,hC - or numeric float values.  For the attempted values of the altitudes all being equal to sqrt(30/2, the triangle is equilateral of side 1.

  Any suggestions to get this to work in Maple 7would be most appreciated.

Thanks,

   David

 

 

> restart:

# # # # # # # # # # # # # # # # # # # # # # # # # # # #

# Altitude exploration 

# Trying to obtain expressions for the sides a,b,c of a triangle
# given the altitudes.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # #

#with(plots):

#with(plottools):

#with(geometry):

Sol->[solve({hA=(a+b+c)/a, hB=(a+b+c)/b, hC=(a+b+c)/c},{a,b,c}  )];  #,explicit)];

#  ???Is explicit needed?? Is it a Maple 7 feature?

 

abc:=simplify(eval(Sol,[hA=sqrt(3)/2,hB=sqrt(3)/2, hC=sqrt(3)/2]));  #should give a=b=c=1

gf:=eval(Sol, a=1);

 

Warning, the name changecoords has been redefined

 

I am interested in the 5 circle theorem of Miquel.  Search on the internet 'Miquel five circle theorem' for more details. I would like to prove this theorem using Maple, and also see if there is a generalisation to this for more than 5 circles.  I wish to find the points of intersection of the circles and am using the fsolve command:

fsolve({(x-x[i])^2+(y-y[i])^2-r[i]^2, (x-x[i-1])^2+(y-y[i-1])^2-r[i-1]^2}, {x, y});

I am using the curly braces for sets - as I can't seem to get it to work for [] lists.   The output gives something like {x=12.0005, y=4.65}.  I want to use these values to obtain straight line equations and verify that the lines formed by successive circles form a pentagram, with all vertices on the five circles.  I just want to get to the floating point values, without the x= part.  The type of the returned expressions is '=' - whatever that means!

    I'm also wondering if using the plottools and plots packages is sufficient - as opposed to the geometry pakage.

I'm interested in how many people have heard of this theorem.  Does it have any generalisations to 6, 7, ... circles?

Any help or comments gratefully received.

    David.   

5 6 7 8 9 10 11 Page 7 of 11