Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
/* * This file: * http://anggtwu.net/.maxima/maxima-init.mac.html * http://anggtwu.net/.maxima/maxima-init.mac * (find-angg ".maxima/maxima-init.mac") * Author: Eduardo Ochs <eduardoochs@gmail.com> * * See: (find-es "maxima" "init-file") * * «.seq» (to "seq") * «.format» (to "format") * «.traverse» (to "traverse") * «.align_eqs» (to "align_eqs") * «.mapconcat» (to "mapconcat") * «.load_qdraw» (to "load_qdraw") * «.HOME» (to "HOME") * «.DDef» (to "DDef") */ /* «seq» (to ".seq") * (find-es "maxima" "seq") */ seq (a,b) := makelist(i, i,a,b); seqby(a,b,stp) := makelist(i, i,a,b,stp); seqn (a,b,n) := makelist(a + (b-a)*k/n, k,0,n); /* * (eepitch-maxima) * (eepitch-kill) * (eepitch-maxima) seq (2,5); seq (5,2); seqby(5,2,-1); seqby(2,20,3); seqn (2,4,6); */ /* «format» (to ".format") * (find-es "maxima" "format") */ format([args]) := apply(?format, append([false], args)); /* «traverse» (to ".traverse") * (find-es "maxima" "op-and-args") * (find-angg "MAXIMA/traverse.mac") */ traverse_1 : lambda([o, action], if is(action = 'op) then op(o) elseif is(action = 'args) then args(o) else args(o)[action]); traverse(o, [actions]) := xreduce('traverse_1, actions, o); /* * (eepitch-maxima) * (eepitch-kill) * (eepitch-maxima) load("maxima-init.mac"); o : a*b + c/d; traverse(o); traverse(o, op); traverse(o, args); traverse(o, 1); traverse(o, 1, op); traverse(o, 1, args); */ /* «align_eqs» (to ".align_eqs") * (find-es "maxima" "align_eqs") */ align_eqs(as) := apply('matrix, align_eqs_0(as))$ align_eqs_0(as) := append([[as[1], "=", as[2]]], makelist(["", "=", as[i]], i, 3, length(as)))$ /* * (eepitch-maxima) * (eepitch-kill) * (eepitch-maxima) a : [11, 22, 33, 44, 55, 66]; align_eqs(a); */ /* «mapconcat» (to ".mapconcat") * Moved to: (find-myqdraw "myqdraw-core.mac" "mapconcat") */ /* «load_qdraw» (to ".load_qdraw") * See: (find-windows-beginner-intro "12. Install qdraw") * (find-myqdraw "myqdraw3.mac" "load") * http://anggtwu.net/eev-qdraw.html */ load_qdraw () := load("~/myqdraw/qdraw.mac"); load_myqdraw() := load("~/myqdraw/myqdraw3.mac"); /* * (eepitch-maxima) * (eepitch-kill) * (eepitch-maxima) load_myqdraw(); [p1,p2,p3] : [pts([[1,1]]), pts([[2,2]]), pts([[3,3]])]; qdrawv (p1,p2,p3); qdraw1v(p1,p2,p3); qdraw1 (p1,p2,p3); qdraw (p1,p2,p3); */ /* «HOME» (to ".HOME") * (find-es "maxima" "getenv") */ HOME() := (load("operatingsystem"), getenv("HOME"))$ /* «DDef» (to ".DDef") * (find-es "maxima" "DDef") */ DDef1(fxy) := buildq([f:op(fxy),xy:args(fxy)], define(f(splice(xy)),f))$ DDef([fxys]) ::= map('DDef1,fxys)$