das1404

135 Reputation

6 Badges

12 years, 24 days

MaplePrimes Activity


These are replies submitted by das1404

@Kitonum   I loaded your program OK.  Rather than run it in stages, I reduced the number of frames from 60 down to 6.

It didn't like the N, and Boundary parameters in the Picture proc.  Towards the end is a line:

LetterD:=plots [display](plot ([0.62, [-0.75t...   t=0..Pi/2   x=-.83..-.75...

This plot command has two variables t & x.  In Maple 7 documentation it has plot (f,h,v)  where f is a function ( or functions), his a horizontal range, and v a vertical range.  So Maple 7 came up with invalid arguments.

   Thanks for your help.

@tomleslie   The mws extension loaded OK.  There were a few minor hinges like the font differences, but images are not dealt with in Maple 7.  Png files are not mentioned in the documentation so I created  gif files of the letters A and B.  It came up with error message: plottools does not evaluate to a module.  It doesn't seem to like the plottools:-exportplot(FA,p): 

  Also  A:=plot3d (1,....,image=FA)   

    Thanks for your time and comments.   Oh....   "...all the way back to Maple 2018" - since we are in 2018, I thought that was the very latest version!  Apparently not! 

@tomleslie 

Thanks for your input, but I haven't been able to save your file, let alone view it.  I see it has an extension .mw, rather than .mws.  Why the difference? 

@Kitonum 

Thanks for that but sad to say it does not work in Maple 7.  It came up with an error message 'Invalid font specification', ...after which it closed Maple.  I notice the file size is 2.97 Mb, which is huge!   I recall looking at the output of possibly that file.  It was quite intricate and had code for the serifs of the letter D.  My aspirations aren't as lofty: I'm using chunky block graphics.  When I looked for the post on Maple primes I couldn't find it. 

Thanks for that.  Your animation is much, much smoother.  However, looking further down the track, when I want to put letters side by side, I think I'll need to stick to 2D.  There is another variation of the rotate command, rotating alpha, beta, gamma about the axes.  That looks promising.

    I was working in 3D coords as I didn't realize how versatile the Maple rotate command was.  I thought it was restricted to rotating about the z-axis only.  I spent a lot of time working from scratch trying to develop a matrix for rotation!:-(   Maple amazes me in how powerful it is -and I'm using an old version!

Thanks again, David

@das1404 

Further to my question regards axes=normal and the program LetterA_Axes_query.mws,   is there any general rule for the precedence of options commands in displaying plots?  For example in the above, the option in the proc took precedence over the called plot.  

   Would I be right in thinking it's better to omit option commands in a proc call, and set them later when calling the proc?

Thanks,

   David 

@Kitonum Thanks again!

Lett_B_anim_imp_plot.mws@acer 

      This is a "progress report", rather than a question.  The attached program first shows some graphs of an implicit function which could be used in drawing the curved portions of the letters B, D, G, P, Q, R.  The implicit function chosen is just a variant of the ellipse, with the powers being changed, and also instead of just the sqrt, the power 1/m is used for differing m. I was disappointed in that nobody commented on Bezier curves.  I suppose they are incorporated in later versions of Maple.

    Following that is my attempt at the letter B, with some animation.  It still requires a lot of work, as it needs to be the same size as other letters.  ...but I'm leaving it for the present.

   Again, many thanks for your help.

David

Letts_textplot_Maple7.mws@vv 

   I attempted to see if I could retrieve something in Maple 7.  I have only just read Acer's commentt that it i not possible.  For what it's worth my attempt is above: obtaining an image is not possible, despite lots of documentaion on exporting files in the documentaion.  Further comments in the code.

Many thanks.  David

LetterD_using_proc.mws@acer 

Thanks for the confirmation.  Have taken your suggestion and put it in a proc.  I was expecting to ask you all sorts of questions regards the curving portion of the letter D, but as you see it rotates OK.  Magic!

David

makeA_from_Acer.mws@acer 

Thanks for your reply.  Your program works fine in Maple 7.  I have put a link to the program, with slight modifications.  I was very surprised that it worked.  I've always followed Maple 7 documentation which uses CAPITAL letters for PATCHNOGRID, but it seems happy with lower case too.  I've no idea what 'patchnogrid' meant, and thought it was something to do with displaying the axes.  However, putting in 'patch' displayed the three separate polygons, so presumably 'patchnogrid' removes the outline of the polygons.   I looked up 'patch' on Maple 7 Help and there is a 'patchlevel' variable in the interface.  You'll see I've tried to access this without success. 

  Thanks forr your help& suggestions, which will help no end in drawing other letters. 

Cheers, David 

 

@acer

Thanks for the very simple ideas which had never occured to me.  

I ran your program in Maple 7.  It didn't like 'uses plots;'    It came up with the message: Missing operator or ;  There was no mention of the word 'uses' in the help section so I think that 'uses' is an addition to later versions.  It does however refer to 'use', but I've never come across that before.  

   I omitted 'uses plots;' statement and makeA(); came up with the three polygons in the shape of A.  These had no color, and I wondered why your output was black.  I'm just going on the displayed program: I didn't download your program, but just typed it in.  There is no mention of color=black there.  Perhaps your version of Maple defaults to filling in polygons in black?  ...a touch of Henry Ford:-)

 Regards the rotate it didn't seem to like plots:-display...   Error message does not evaluate to a module.  I just changed that to   

plots[display](rotate(....)   and it worked fine.

   Again, thanks for your prompt reply and helpful advice..  

Hi  Rouben,

   Thanks for your suggestions.  It took me a while to find the "big fat green arrow" - it is not so big on my computer.  I've also pressed the wrong selection as there are three whole programs below.  I'll maybe try again later and choose 'link' instead.  For the moment you should be able to see the output generated by the three programs.

First:  Displays the rotated letter A - working OK

Second:  Displays my attempt at the letter D - and this too looks OK, except the actual dimensions are quite small.

Third:  This is the program I was really querying.  The code from the Second program was insserted into this, but the output is almost non-existent.  You can see the output before the large display of the rotated letter A.  Why has it not given the same output as Prog 2?

   Thanks very much for the information on the 'rotate' function. My query is will 'rotate' work on the curved letter D?  Letter A is a polygon - is the structure of D similar, but with just more points?

David 

 

  
 

restart:
# # # # # # # # # # # #  # # # # # # # #
# Second attempt at the letter A: earlier working version was
# letterA_Art_trick.mws
# Functional operators.  Use of ->
# to find coords of rotated points.
  
# # Orientation looks wrong
#  Check - then put in a proc
# # # # # # # # # # # # #  # # # # # # # #
with(plots):
with(plottools):
# Following are parameters for A : put in proc(...)
l:=12:w:=2:thet:=Pi/2.7:topl:=2:x0:=2:y0:=5:phi:=3*Pi/4:
 h := (x, y) -> [x*cos(phi)-y*sin(phi), x*sin(phi)+y*cos(phi)]:

#Alist is list of coords for letter A
Alist:=[[x0,y0],[x0+l*cos(thet),y0+l*sin(thet)],[x0+l*cos(thet)+topl,y0+l*sin(thet)],[x0+2*l*cos(thet)+topl,y0], [x0+2*l*cos(thet)+topl-w,y0],[x0+5*l*cos(thet)/3+topl-w,y0+l*sin(thet)/3],[x0+l*cos(thet)/3+w,y0+l*sin(thet)/3], [x0+w,y0]]:
#outA:=polygon([[x0,y0],[x0+l*cos(thet),y0+l*sin(thet)],[x0+l*cos(thet)+topl,y0+l*sin(thet)],[x0+2*l*cos(thet)+topl,y0], [x0+2*l*cos(thet)+topl-w,y0],[x0+5*l*cos(thet)/3+topl-w,y0+l*sin(thet)/3],[x0+l*cos(thet)/3+w,y0+l*sin(thet)/3], [x0+w,y0]]):

#trigA is small inner triangle of letter A - not rotated

eps:=3*w/4:
corr:=.3*w:
#trigA:=polygon([[x0+(2*l*cos(thet)+topl)/2, #y0+l*sin(thet)-eps],[x0+w+(l/3+corr*w)*cos(thet), #y0+(l/3+corr*w)*sin(thet)],[x0+2*l*cos(thet)+topl-w-(l/3+corr*w)*cos(thet)#, y0+(l/3+corr*w)*sin(thet)]], color=white):

trigA_L:=[[x0+(2*l*cos(thet)+topl)/2, y0+l*sin(thet)-eps],[x0+w+(l/3+corr*w)*cos(thet), y0+(l/3+corr*w)*sin(thet)],[x0+2*l*cos(thet)+topl-w-(l/3+corr*w)*cos(thet), y0+(l/3+corr*w)*sin(thet)]]:
trigArL:=[]:
for i from 1 to 3 do
  #Get coords from trigA_L
x:=trigA_L[i][1]:
y:=trigA_L[i][2]:

# Add coords to new rotated list trigAr
#L := [op(L),x[5]];
trigArL:=[op(trigArL), h(x,y)]:
end do:
#trigArL;
trigAr := polygon(trigArL, color=white, linestyle=1, thickness=1):
#plots[display](trigAr);

#Read coords of Alist into another list after first transforming the #coords using func op h.  Angle of rot is phi.  thet is inclination of #letter A
#Main Outline of letter - but NOT the convex hull
Alistr:=[]:
#  h := (x, y) -> [x*cos(phi)-y*sin(phi), x*sin(phi)+y*cos(phi)]:
for i from 1 to 8 do
  #Get coords from Alist
x:=Alist[i][1]:
y:=Alist[i][2]:

# Add coords to new rotated list Alistr
#L := [op(L),x[5]];
Alistr:=[op(Alistr), h(x,y)]:
end do:
l2 := polygon(Alistr, color=wheat, linestyle=1, thickness=1):

# # # # # # # # # # # # # # # # #
#plots[display](trigAr,l2);
#plots[display](trigAr,trapezL, l2);
#trigAr,

#thet:=Pi/3:
# Rotation by thet  anti-clockwise about the origin
#h := (x, y) -> [x*cos(thet)-y*sin(thet), x*sin(thet)+y*cos(thet)]:
#h(sqrt(3), 1);

# To find a polygon (trapezium EFGH??) which is the shape of he base of A.
# This is necessary as this portion is colored same as rest of A.
#trapezr:=polygon([[(x0+2*l*cos(thet)+topl-w)*cos(phi)-y0*sin(phi),(x0+2*l*#cos(thet)+topl-w)*sin(phi)+y0*cos(phi)],[(x0+5*l*cos(thet)/3+topl-w)*cos(p#hi)-(y0+l*sin(thet)/3)*sin(phi),(x0+5*l*cos(thet)/3+topl-w)*sin(phi)+(y0+l#*sin(thet)/3)*cos(phi)],[(x0+l*cos(thet)/3+w)*cos(phi)-(y0+l*sin(thet)/3)*#sin(phi),(x0+l*cos(thet)/3+w)*sin(phi)+(y0+l*sin(thet)/3)*cos(phi)],[(x0+w#)*cos(phi)-y0*sin(phi),(x0+w)*sin(phi)+y0*cos(phi)]],color=white,filled=tr#ue,  linestyle=DOT):

#trapezL is a list of coords of the base trapezium
#THESE coords have not been rotated.  Repeat previous procedure to obtain #rotated coords
trapezr:=[]:
for i from 5 to 8 do
  #Get coords from Alist
x:=Alist[i][1]:
y:=Alist[i][2]:

# Add coords to rotated list trapezr
trapezr:=[op(trapezr), h(x,y)]:
end do:
#trap2 := polygon(trapezr, color=wheat, linestyle=1, thickness=1):

#trapezL:=polygon([[x0+2*l*cos(thet)+topl-w,y0],[x0+5*l*cos(thet)/3+topl-w,y0+l*sin(thet)/3],[x0+l*cos(thet)/3+w,y0+l*sin(thet)/3], [x0+w,y0]], color=red):
trapezL:=polygon(trapezr, color=white):

# lbase is an unseen line at base of the trapezium of A.  Colored white # as needed to be hidden
lbase:=line([(x0+2*l*cos(thet)+topl-w)*cos(phi)-y0*sin(phi),(x0+2*l*cos(thet)+topl-w)*sin(phi)+y0*cos(phi)], [(x0+w)*cos(phi)-y0*sin(phi),(x0+w)*sin(phi)+y0*cos(phi)], color=white):


plots[display](trigAr,lbase,trapezL, l2, scaling=constrained);

#Non numeric vertex defintions in both these
#,trapezL,  lbase,trigAr,
#lbase,trapezL,

#Animation
noframes:=96:
for i from 0 to noframes do
plot1[i]:=poly_out(Pi/2.7,15,3,3, 2,1, 2*Pi*i/noframes):
plot2[i]:=poly_out(Pi/2.7,15,3,3, 2+i/noframes,1+i*(noframes-i)/noframes, 0):
end do:

###plots[display](seq(plot1[i],i=0..noframes),seq(plot2[i],i=0..noframes), insequence=true, scaling=constrained,  axes=none);  #, view=[0..20, 0..18.7]);

Warning, the name changecoords has been redefined

Warning, the name arrow has been redefined

 

 


 

Download LetterA_using_func_ops.mws
 

restart;
#Letter D
with(plots):
with(plottools):

a := .6: b := .5: x0 := 1: y0:=7:
c1:=15:n:=4:
#eq := (x-x0)^n/a^2 + (y-y0)^n/b^2 = c1:

# Letter D  (or top part of B!)
a := .6: b := .5: x0 := 1: y0:=7:
c1:=15:n:=4:
pl1:=plot([x, y0+b^2*sqrt(c1-(x-x0)^n/a^2), x=1..2.6], scaling=constrained, color=wheat,filled=true):
pl2:=plot([x, y0-b^2*sqrt(c1-(x-x0)^n/a^2), x=1..2.6], scaling=constrained, color=white, filled=true):
pl3:=plot([x, y0+b^2*sqrt(c1/2-(x-x0)^n/a^2), x=1.3..3], scaling=constrained, color=white,filled=true):
pl4:=plot([x, y0-b^2*sqrt(c1/2-(x-x0)^n/a^2), x=1.3..3], scaling=constrained,color=wheat, filled=true):
x:=1.3:
#Create & Draw inner up line of D
ylow:=eval(y0-b^2*sqrt(c1/2-(x-x0)^n/a^2)):
yhigh:=eval(y0+b^2*sqrt(c1/2-(x-x0)^n/a^2)):
l_up_in:=line([x,ylow], [x,yhigh], color=wheat):
#Create & Draw outer up line of D
x:=1:
ylow:=eval(y0-b^2*sqrt(c1-(x-x0)^n/a^2)):
yhigh:=eval(y0+b^2*sqrt(c1-(x-x0)^n/a^2)):
l_up_out:=line([x,ylow], [x,yhigh], color=white):
plots[display]( pl2,pl4,pl3,l_up_in,l_up_out,pl1, scaling=constrained, view=[1..2.6, 6..8.1]);
 

 

Warning, the name changecoords has been redefined

Warning, the name arrow has been redefined

 

 

 

 


 

Download letterD_for_MapleForum.mws
 

restart:
# # # # # # # # # # # #  # # # # # # # #
# Second attempt at the letter A: earlier working version was
# letterA_Art_trick.mws
# Functional operators.  Use of ->
# to find coords of rotated points.

#To Do:  
#Rotate Trig through phi
#   "   trapezL
# Orientation looks wrong
#  Check - then put in a proc
# non-numeric vertex in trigArL
# # # # # # # # # # # #  # # # # # # # #
with(plots):
with(plottools):
# Following are parameters for A : to later put in proc(...)
# phi rotates the A through that angle about the origin/
l:=12:w:=2:thet:=Pi/2.7:topl:=2:x0:=2:y0:=5:phi:=3*Pi/4:
 h := (x, y) -> [x*cos(phi)-y*sin(phi), x*sin(phi)+y*cos(phi)]:

#Alist is list of coords for letter A
Alist:=[[x0,y0],[x0+l*cos(thet),y0+l*sin(thet)],[x0+l*cos(thet)+topl,y0+l*sin(thet)],[x0+2*l*cos(thet)+topl,y0], [x0+2*l*cos(thet)+topl-w,y0],[x0+5*l*cos(thet)/3+topl-w,y0+l*sin(thet)/3],[x0+l*cos(thet)/3+w,y0+l*sin(thet)/3], [x0+w,y0]]:
#outA:=polygon([[x0,y0],[x0+l*cos(thet),y0+l*sin(thet)],[x0+l*cos(thet)+topl,y0+l*sin(thet)],[x0+2*l*cos(thet)+topl,y0], [x0+2*l*cos(thet)+topl-w,y0],[x0+5*l*cos(thet)/3+topl-w,y0+l*sin(thet)/3],[x0+l*cos(thet)/3+w,y0+l*sin(thet)/3], [x0+w,y0]]):

#trigA is small inner triangle of letter A - not rotated

eps:=3*w/4:
corr:=.3*w:
#trigA:=polygon([[x0+(2*l*cos(thet)+topl)/2, #y0+l*sin(thet)-eps],[x0+w+(l/3+corr*w)*cos(thet), #y0+(l/3+corr*w)*sin(thet)],[x0+2*l*cos(thet)+topl-w-(l/3+corr*w)*cos(thet)#, y0+(l/3+corr*w)*sin(thet)]], color=white):

trigA_L:=[[x0+(2*l*cos(thet)+topl)/2, y0+l*sin(thet)-eps],[x0+w+(l/3+corr*w)*cos(thet), y0+(l/3+corr*w)*sin(thet)],[x0+2*l*cos(thet)+topl-w-(l/3+corr*w)*cos(thet), y0+(l/3+corr*w)*sin(thet)]]:
trigArL:=[]:
for i from 1 to 3 do
  #Get coords from trigA_L
x:=trigA_L[i][1]:
y:=trigA_L[i][2]:

# Add coords to new rotated list trigAr
#L := [op(L),x[5]];
trigArL:=[op(trigArL), h(x,y)]:
end do:
#trigArL;
trigAr := polygon(trigArL, color=white, linestyle=1, thickness=1):
#plots[display](trigAr);

#Read coords of Alist into another list after first transforming the #coords using func op h.  Angle of rot is phi.  thet is inclination of #letter A
#Main Outline of letter - but NOT the convex hull
Alistr:=[]:
#  h := (x, y) -> [x*cos(phi)-y*sin(phi), x*sin(phi)+y*cos(phi)]:
for i from 1 to 8 do
  #Get coords from Alist
x:=Alist[i][1]:
y:=Alist[i][2]:

# Add coords to new rotated list Alistr
#L := [op(L),x[5]];
Alistr:=[op(Alistr), h(x,y)]:
end do:
l2 := polygon(Alistr, color=wheat, linestyle=1, thickness=1):

# # # # # # # # # # # # # # # # #
#plots[display](trigAr,l2);
#plots[display](trigAr,trapezL, l2);
#trigAr,

#thet:=Pi/3:
# Rotation by thet  anti-clockwise about the origin
#h := (x, y) -> [x*cos(thet)-y*sin(thet), x*sin(thet)+y*cos(thet)]:
#h(sqrt(3), 1);

# To find a polygon (trapezium EFGH??) which is the shape of he base of A.
# This is necessary as this portion is colored same as rest of A.
#trapezr:=polygon([[(x0+2*l*cos(thet)+topl-w)*cos(phi)-y0*sin(phi),(x0+2*l*#cos(thet)+topl-w)*sin(phi)+y0*cos(phi)],[(x0+5*l*cos(thet)/3+topl-w)*cos(p#hi)-(y0+l*sin(thet)/3)*sin(phi),(x0+5*l*cos(thet)/3+topl-w)*sin(phi)+(y0+l#*sin(thet)/3)*cos(phi)],[(x0+l*cos(thet)/3+w)*cos(phi)-(y0+l*sin(thet)/3)*#sin(phi),(x0+l*cos(thet)/3+w)*sin(phi)+(y0+l*sin(thet)/3)*cos(phi)],[(x0+w#)*cos(phi)-y0*sin(phi),(x0+w)*sin(phi)+y0*cos(phi)]],color=white,filled=tr#ue,  linestyle=DOT):

#trapezL is a list of coords of the base trapezium
#THESE coords have not been rotated.  Repeat previous procedure to obtain #rotated coords
trapezr:=[]:
for i from 5 to 8 do
  #Get coords from Alist
x:=Alist[i][1]:
y:=Alist[i][2]:

# Add coords to rotated list trapezr
trapezr:=[op(trapezr), h(x,y)]:
end do:
#trap2 := polygon(trapezr, color=wheat, linestyle=1, thickness=1):

#trapezL:=polygon([[x0+2*l*cos(thet)+topl-w,y0],[x0+5*l*cos(thet)/3+topl-w,y0+l*sin(thet)/3],[x0+l*cos(thet)/3+w,y0+l*sin(thet)/3], [x0+w,y0]], color=red):
trapezL:=polygon(trapezr, color=white):

# lbase is an unseen line at base of the trapezium of A.  Colored white # as needed to be hidden
lbase:=line([(x0+2*l*cos(thet)+topl-w)*cos(phi)-y0*sin(phi),(x0+2*l*cos(thet)+topl-w)*sin(phi)+y0*cos(phi)], [(x0+w)*cos(phi)-y0*sin(phi),(x0+w)*sin(phi)+y0*cos(phi)], color=white):

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Letter D  (or top part of B!)
a := .6: b := .5: x0D := 1: y0D:=7:
c1:=15:n:=4:
pl1:=plot([x, y0D+b^2*sqrt(c1-(x-x0D)^n/a^2), x=1..2.6], scaling=constrained, color=wheat,filled=true):
pl2:=plot([x, y0D-b^2*sqrt(c1-(x-x0D)^n/a^2), x=1..2.6], scaling=constrained, color=red, filled=true):  #was white
pl3:=plot([x, y0D+b^2*sqrt(c1/2-(x-x0D)^n/a^2), x=1.3..3], scaling=constrained, color=blue,filled=true):  #was white
pl4:=plot([x, y0D-b^2*sqrt(c1/2-(x-x0D)^n/a^2), x=1.3..3], scaling=constrained,color=wheat, filled=true):
x:=1.3:
#Create & Draw inner up line of D
ylow:=eval(y0D-b^2*sqrt(c1/2-(x-x0D)^n/a^2)):
yhigh:=eval(y0D+b^2*sqrt(c1/2-(x-x0D)^n/a^2)):
l_up_in:=line([x,ylow], [x,yhigh], color=wheat):
#Create & Draw outer up line of D
x:=1:
ylow:=eval(y0D-b^2*sqrt(c1-(x-x0D)^n/a^2)):
yhigh:=eval(y0D+b^2*sqrt(c1-(x-x0D)^n/a^2)):
l_up_out:=line([x,ylow], [x,yhigh], color=white):
plots[display]( pl2,pl4,pl3,l_up_in,l_up_out,pl1, scaling=constrained, view=[1..2.6, 6..8.1]);
# removed l_up_in, before l_up_out - no difference
# # # # # # # # # # # # # # # # # # # # # # # # - End of letter D - # # # #
# Display letter A
plots[display](trigAr,lbase,trapezL, l2);


#Animation
#noframes:=96:
#for i from 0 to noframes do
#plot1[i]:=poly_out(Pi/2.7,15,3,3, 2,1, 2*Pi*i/noframes):
#plot2[i]:=poly_out(Pi/2.7,15,3,3, 2+i/noframes,1+i*(noframes-i)/noframes, #0):
#end do:

###plots[display](seq(plot1[i],i=0..noframes),seq(plot2[i],i=0..noframes), insequence=true, scaling=constrained,  axes=none);  #, view=[0..20, 0..18.7]);

Warning, the name changecoords has been redefined

Warning, the name arrow has been redefined

 

 


 

Download LettersA_D.mws

 

 

@Rouben Rostamian  

Thanks Rouben and vv3354 for your comments.  I have found them thought provoking, particularly Rvachev's method.  They provide some useful input. However they do not address the optical illusion side of my question.

     For those thinking that this subject is more adapted to a drawing package, rather than Maple, I have some knowledge of Photoshop and find that one still needs the abilities of an artist to wield the mouse akin to a pencil or brush.  Maple is mathematically and graphically orientated, so requires a different set of skills. Optical illusions have a fairly long history: from Escher, disguising a battleship in WW2, and more recently check out Kokichi Sugihara, a Japanese maths professor who has some fascinating YouTube videos of 3D objects which are optical illusions.  Thanks again and am still open for more comments/suggeestions.

 

@Kitonum 

Thanks again.  It works well.  The only modifications needed were in the font specifications for Maple 7.  It seems more fussy: I changed it to font(TIMES,ROMAN,14]  and ditto for the titlefont.   ROMAN is a style option: the uppercase seems mandatory.

Cheers, David

2 3 4 5 6 7 8 Page 4 of 8