Question: How do I make a package or module

Hello:

I want to make a package or module. Not sure. I cant get my head around what to do. I have loads of formulas I would like to be able to use without going back through work sheets. At present just want to keep it simple.

Have loaded a sample work sheet to use

Intend to place package in Maple2016 library folder.

 

restart

Library Folder

C:\Program Files\Maple 2016\lib

``

``

with(LinearAlgebra):

``

``

Points

Point2 := proc (x1, y1) options operator, arrow; [x1, y1] end proc

proc (x1, y1) options operator, arrow; [x1, y1] end proc

(1)

Point3 := proc (x1, y1, z1) options operator, arrow; [x1, y1, z1] end proc

proc (x1, y1, z1) options operator, arrow; [x1, y1, z1] end proc

(2)

a1 := Point3(x1, y1, z1)

[x1, y1, z1]

(3)

a2 := Point3(x2, y2, z2)

[x2, y2, z2]

(4)

a3 := Point3(x3, y3, z3)

[x3, y3, z3]

(5)

Line through 2 points

LinePts := proc (p1, p2) options operator, arrow; (p2[2]-p1[2])*x+(p1[1]-p2[1])*y-p2[2]*p1[1]+p1[2]*p2[1] end proc

proc (p1, p2) options operator, arrow; (p2[2]-p1[2])*x+(p1[1]-p2[1])*y-p2[2]*p1[1]+p1[2]*p2[1] end proc

(6)

``

Line

Line := proc (a, b, c) options operator, arrow; a*x+b*y+c end proc

proc (a, b, c) options operator, arrow; a*x+b*y+c end proc

(7)

Lines s

LnPrll := proc (l1, l2) options operator, arrow; is(coeff(l1, x)*coeff(l2, y)-coeff(l2, x)*coeff(l1, y) = 0) end proc

proc (l1, l2) options operator, arrow; is(coeff(l1, x)*coeff(l2, y)-coeff(l2, x)*coeff(l1, y) = 0) end proc

(8)

Lines t

LnPrpnd := proc (l1, l2) options operator, arrow; is(coeff(l1, x)*coeff(l2, x)+coeff(l1, y)*coeff(l2, y) = 0) end proc

proc (l1, l2) options operator, arrow; is(coeff(l1, x)*coeff(l2, x)+coeff(l1, y)*coeff(l2, y) = 0) end proc

(9)

``

``

Quadrance between 2 points (2D)

Quadrance := proc (a1, a2) options operator, arrow; (a1[1]-a2[1])^2+(a1[2]-a2[2])^2 end proc

proc (a1, a2) options operator, arrow; (a1[1]-a2[1])^2+(a1[2]-a2[2])^2 end proc

(10)

``

Quadrance between 2 points (3D)

Qd3 := proc (a1, a2) options operator, arrow; (a1[1]-a2[1])^2+(a1[2]-a2[2])^2+(a1[3]-a2[3])^2 end proc

proc (a1, a2) options operator, arrow; (a1[1]-a2[1])^2+(a1[2]-a2[2])^2+(a1[3]-a2[3])^2 end proc

(11)

Triple Quad Formula (3 colinear points)

TQF := proc (Q1, Q2, Q3) options operator, arrow; (Q1+Q2+Q3)^2 = 2*Q1^2+2*Q2^2+2*Q3^2 end proc

proc (Q1, Q2, Q3) options operator, arrow; (Q1+Q2+Q3)^2 = 2*Q1^2+2*Q2^2+2*Q3^2 end proc

(12)

Spread*PolynomialsNULL

SpreadPoly := proc (n, s, rn) with(orthopoly); s-factor(1/2-(1/2)*T(n, 1-2*rn)) end proc

proc (n, s, rn) with(orthopoly); s-factor(1/2-(1/2)*T(n, 1-2*rn)) end proc

(13)

SpreadPoly(3, s, r)

s-r*(4*r-3)^2

(14)

``

 

Download Testpackage.mw

Please Wait...