375 Reputation

6 years, 200 days

Search for congruent numbers...

Maple 2021

Cong:=proc(n)
local  a,b,An,Bn,Cn,Dn:
if n mod 2 = 1
An:=0:     Bn:=0:
for a  from (round(-sqrt(n/(2)))) to round(sqrt(n/(2)) )
do:
for b  from (round(-sqrt(n)) )to round(sqrt(n) )do :
if (sqrt(n-2*a^(2)-b^(2)) )/(32)isInteger
then An:=An+1
elif (sqrt(n-2*a^(2)-b^(2)) )/(8) isInteger
then Bn:=Bn+1  fi:
od:  od:
if 2*An=Bn
return(True)  else  return(False)
fi: else if n mod 2 = 0 :
Cn:=0:  Dn:=0:
for a  from (round(-sqrt(n/(8)))) to round(sqrt(n/(8)) )
do :
for b  from (round(-sqrt(n/(2)))) to round(sqrt(n/(2))) do:
f (sqrt(n/(2)-4*a^(2)-b^(2)) )/(32)isInteger
then Cn:=Cn+1
elif (sqrt(n/(2)-4*a^(2)-b^(2)) )/(8) isInteger
then Dn:=Dn+1 fi: od:  od:
if 2*Cn=Dn:
return(True)  else  return(False)fi:
end:

Why do I get this messge : Error, unterminated procedure. Thank you.

Conversion of barycentric coordinates in...

Maple

How to convert barycentric coordinates to cartesian ? Thank you

Difficulty with Transpose...

Maple 2021

with(geometry);
with(LinearAlgebra);
xA := 1;
yA := 0;
xB := 0;
yB := 0;
xC := 0;
yC := 1;
Mat := Matrix(3, 3, [xA, xB, xC, yA, yB, yC, 1, 1, 1]);
Miv := MatrixInverse(Mat);
phi := (x, y) -> Transpose(Multiphy(Miv), <x, y, 1>);
for i to 6 do
B || i := phi(xA || i, yA || i);
end do;
Error, (in LinearAlgebra:-Transpose) invalid input: too many and/or wrong type of arguments passed to LinearAlgebra:-Transpose; first unused argument is Vector(3, {(1) = xA1, (2) = yA1, (3) = 1})
How to correct this error ? Thank you.

I cannot solve this problem of drawing...

Maple 2021

point(A, xA, yA);
point(B, xB, yB);
point(C, xC, yC):
L3 := linestyle = 3
triangle(Tr, [A, B, C])
line(AP, [A, P]);
line(BP, [B, P]);
line(CP, [C, P]);
dr := draw([Tr(t3), AP(cbl, L3), BP(cbl, L3), CP(cbl, L3)]),
textplot([[coordinates(A)[], "A"], [coordinates(B)[], "B"], [coordinates(C)[], "C"]], align = {above, right});
display({dr, ellip}, scaling = constrained, axes = none, view = [-1 .. 14, -1 .. 11]);
Why doesn’t Maple show me the expected effect ? Thank you.

 1 2 3 4 5 6 7 Last Page 1 of 27
﻿