Traruh Synred

55 Reputation

3 Badges

8 years, 116 days

MaplePrimes Activity


These are questions asked by Traruh Synred

I just got an email saying a maple primes moderator deleted my question as 'SPAM'. It was not remotely SPAM but a strraight forward question about how to determine lengths of lines drawn in Maple Sketcher. 

The email tells me and gives me a link to 'contact' but it's not clear which of the many possible contacts listed to use!

Here's the email:

Your MaplePrimes post Length of a line drawn in Sketcher? was deleted by a moderator for the following reason: Spam. If you believe this was done in error, please contact Maplesoft customer service: https://www.maplesoft.com/contact.

I'd like to use Maple to make measurements on a map (Dealey Plaza). I can load an image in Sketcher and draw lines on it, but can't figure out how to access the lengths of those lines.

restart``

estart; with(Physics); with(LinearAlgebra); with(VectorCalculus); with(Optimization); with(Statistics); with(ArrayTools); with(plottools); with(plots); with(Threads); with(MmaTranslator[Mma]), with(StringTools); with(CodeGeneration); VectorCalculus:-`*`(Setup(mathematicalnotation = true), Setup(coordinatesystems = cartesian))

estart

 

[annulus, arc, arrow, circle, cone, cuboid, curve, cutin, cutout, cylinder, disk, dodecahedron, ellipse, ellipticArc, exportplot, extrude, getdata, hemisphere, hexahedron, homothety, hyperbola, icosahedron, importplot, line, octahedron, parallelepiped, pieslice, point, polygon, prism, project, rectangle, reflect, rotate, scale, sector, semitorus, sphere, stellate, tetrahedron, torus, transform, translate]

 

`Default differentiation variables for d_, D_ and dAlembertian are:`*{X = (x, y, z, t)}

 

`Systems of spacetime Coordinates are:`*{X = (x, y, z, t)}

(1)

``

``

NULL

 

``

``

Download DealeyPlazaToo.mw

Using Maple-18 on Window 11...

I have a set of curves in a Maple 'vector.' I want to plot them all on the same figure, but if call 'display' with the vector it makes separate plots for each one. I have to all it with each plot individual to get them on the same plot:

lc is a 'vector' of curves (I use 'vector' because I want to append and that doesn't work for 'list')

display(lc) -- plots a separate plot for each element of lc

display(lc[1], lc[2], lc[3],...) puts them all on one plot as needed, but as there will be a large numbe of curvesr it's extremely tedious.

It is a Huygens principle based simulation of diffraction.

restart

estart; with(Physics); with(LinearAlgebra); with(VectorCalculus); with(Optimization); with(Statistics); with(ArrayTools); with(plots); with(plottools); with(Threads); with(MmaTranslator[Mma]), with(StringTools); with(CodeGeneration); with(ImageTools); with(ImageTools:-Draw); VectorCalculus:-`*`(Setup(mathematicalnotation = true), Setup(coordinatesystems = cartesian))

estart

 

[annulus, arc, arrow, circle, cone, cuboid, curve, cutin, cutout, cylinder, disk, dodecahedron, ellipse, ellipticArc, exportplot, extrude, getdata, hemisphere, hexahedron, homothety, hyperbola, icosahedron, importplot, line, octahedron, parallelepiped, pieslice, point, polygon, prism, project, rectangle, reflect, rotate, scale, sector, semitorus, sphere, stellate, tetrahedron, torus, transform, translate]

 

`Default differentiation variables for d_, D_ and dAlembertian are:`*{X = (x, y, z, t)}

 

`Systems of spacetime Coordinates are:`*{X = (x, y, z, t)}

(1)

NULL

NULL

 

radius := 1.0

1.0

(2)

NULL

NULL

``

NULL

alpha := sin((1/4)*Pi)

(1/2)*2^(1/2)

(3)

step := .2

.2

(4)

radius := 100.0

100.0

(5)

l1 := line([0, 0], [100, 100])

CURVES([[0., 0.], [100., 100.]])

(6)

loAng := 0.

0.

(7)

hiAng := (1/2)*Pi

(1/2)*Pi

(8)

c1 := arc([0, 0.], radius, loAng .. Pi, color = "red")

c2 := arc([step, 0.], -alpha*step+radius, loAng .. hiAng, color = "blue")

c3 := arc([2*step, 0.], -2*alpha*step+radius, loAng .. Pi, color = "purple")

c4 := arc([3*step, 0.], -3*alpha*step+radius, loAng .. Pi, color = "black")

plots[display](l1, c1, c2, c3, c4, view = [0. .. radius, 0 .. radius])

 

`cir≔arc`([x, 0.], radius-step, loAng .. hiAng, i, color = "red")

`cir≔arc`([x, 0.], 99.8, 0. .. (1/2)*Pi, i, color = "red")

(9)

``

xLimitWall := 500.0; nScatter := 20; step := xLimitWall/(nScatter+1); x := 0.; for i from 0 to nScatter do x := x+step; cir := arc([x, 0.], radius-step, 0 .. Pi, color = "red"); if i = 0 then lc := Vector([cir]) else i; cir; Append(lc, cir) end if end do; lc

xLimitWall := 500.0

 

nScatter := 20

 

step := 23.80952381

 

x := 0.

 

x := 23.80952381

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 47.61904762

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 71.42857143

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 95.23809524

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 119.0476190

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 142.8571428

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 166.6666666

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 190.4761904

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 214.2857142

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 238.0952380

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 261.9047618

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 285.7142856

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 309.5238094

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 333.3333332

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 357.1428570

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 380.9523808

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 404.7619046

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 428.5714284

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 452.3809522

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 476.1904760

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

x := 499.9999998

 

cir := CURVES(Vector(4, {(1) = ` 200 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), COLOUR(RGB, 1.00000000, 0., 0.))

 

Vector[column](%id = 4400555778)

(10)

lc[1]

CURVES(Matrix(%id = 4400554242), COLOUR(RGB, 1.00000000, 0., 0.))

(11)

lc(2)

``

lc

lc[1]

``

Download JFKWEdgeDifractionDirection.mwJFKWEdgeDifractionDirection.mwen.

I find that if if declare a variable in a procedure inside a if  statement it Maple things something is wrong with the if statement:

tSound=proc(xMic,yMic,zMic,xGun,yGun,zGun,mode)  

global vSound;  

local locMic:=Vector([xMic,yMix,zMix]);  

local locGun:=Vector([xGun,yGun,zGun]);   l

ocal delGunToMix;   if mode=1 then #`direct  `    

local x=0.0;    <==remove this sand fine

delGunToMix:=locMic-locGun;    

return vSound*Norm(delGunToMix);  

elif  mode=2 then #`reflect off wall at z=0`        

end if;   return 0.0;  end proc:


Error, invalid 'if' statement
==>I can delclare the variable 'local' outside the if. Why? It doesn't make much sense, though not that hard to avoid.

I'd like to plot vectors with one beginning at the head of the other. The application is a reflection at a surface. VectorPositionPlot doesn't seem to do it.

The same kind of plot would be used to illustrate vector addition.

1 2 3 4 Page 1 of 4