Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
/* * This file: * http://anggtwu.net/MAXIMA/zpts1.mac.html * http://anggtwu.net/MAXIMA/zpts1.mac * (find-angg "MAXIMA/zpts1.mac") * Author: Eduardo Ochs <eduardoochs@gmail.com> * * This file extends qdraw with a pseudo-command "zpts", * that plots complex points. * * (find-es "maxima" "2024.1-intro-complex") * (defun e () (interactive) (find-angg "MAXIMA/zpts1.mac")) * (find-es "maxima" "seq") * (find-es "maxima" "seqn") * (find-es "maxima" "create_list") * (find-angg "MAXIMA/myqdraw1.mac") */ /* load_qdraw(); */ load("~/MAXIMA/myqdraw1.mac"); myqdraw0([lists]) := apply('qdraw, flatten([lists])); myqdraw ([lists]) := block([], myqdraw_body : lists, apply('myqdraw0, lists)); seq (a,b) := makelist(i, i, a, b); seqn (a,b,n) := makelist(a + (b-a)*k/n, k, 0, n); ztoxy (z) := [realpart(z), imagpart(z)]; xytoz (x,y) := x + %i*y; zflatten([zs]) := map('ztoxy, flatten(zs)); zpts (zs,[opts]) := apply('pts, append([zflatten(zs)], opts)); /* * (eepitch-maxima) * (eepitch-kill) * (eepitch-maxima) ** (find-angg "MAXIMA/zpts1.mac") load ("~/MAXIMA/zpts1.mac")$ seqn(0,2,4); seqn(2,0,4); create_list(10*a+b, a, [1,2,3], b, [4,5,6]); create_list([x,y], y, [2,1,0], x, [0,1,2]); create_list(x+%i*y, y, [2,1,0], x, [0,1,2]); as_33 : create_list(x+%i*y, y, seqn(2,0,2), x, seqn(0,2,2)); as_55 : create_list(x+%i*y, y, seqn(2,0,4), x, seqn(0,2,4)); as : as_33; myqdraw(xr(-4,4), yr(-4,4), pts(map('ztoxy, as), ps(2), pc(red)), []); myqdraw(xr(-8,8), yr(-8,8), zpts(makelist(z^2, z, as_55), ps(4), pc(red)), zpts(as_55, ps(2), pc(yellow)), []); */ /* * Local Variables: * coding: utf-8-unix * End: */