Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
/* * This file: * http://anggtwu.net/MAXIMA/2025-mysqrt.mac.html * http://anggtwu.net/MAXIMA/2025-mysqrt.mac * (find-angg "MAXIMA/2025-mysqrt.mac") * Author: Eduardo Ochs <eduardoochs@gmail.com> * * (defun e () (interactive) (find-angg "MAXIMA/2025-mysqrt.mac")) * (find-es "maxima" "defmatch") */ matchdeclare(x, all); defmatch(isx2__, x^2); isx2_ (o) := block([x], isx2__(o)); isx2 (o) := not atom(isx2_(o)); isx2_body(o) := if isx2(o) then part(isx2_(o),1,2); sqrtp_ (o) := if isx2(o) then isx2_body(o) else sqrt(o); sqrtn_ (o) := if isx2(o) then -isx2_body(o) else sqrt(o); sqrtp (o) := map('sqrtp_,o); sqrtn (o) := map('sqrtn_,o); sqrtpn (o) := [map('sqrtp,o), map('sqrtn,o)]; /* * (eepitch-maxima) * (eepitch-kill) * (eepitch-maxima) load("2025-mysqrt.mac"); makelist(f(3), f, [isx2,isx2_,isx2_body]); makelist(f((a+b)^2), f, [isx2,isx2_,isx2_body]); makelist(f(3), f, [sqrt,psqrt,nsqrt]); makelist(f((a+b)^2), f, [sqrt,psqrt,nsqrt]); */ V([elts]) := transpose(apply('matrix, [elts])); /* ** (c2m251edovsp 12 "4-inversas") ** (c2m251edovsa "4-inversas") * (eepitch-maxima) * (eepitch-kill) * (eepitch-maxima) load("2025-mysqrt.mac"); display2d : false; o0 : (x-2)^2+(y+3)^2=4; part(o0,1,1); o : o0 - part(o0,1,1); o : sqrtp(o); part(o,1,2); o : o - part(o,1,2); define(g1(y), rhs(o)); o0 : (x-2)^2+(y+3)^2=4; part(o0,1,1); o : o0 - part(o0,1,1); o : sqrtn(o); o : - o; part(o,1,2); o : o - part(o,1,2); define(g2(y), rhs(o)); */ /* * (eepitch-maxima) * (eepitch-kill) * (eepitch-maxima) load("2025-mysqrt.mac"); display2d : false; matchdeclare(x, all); defmatch(isx2__, x^2); isx2_ (o) := block([x], isx2__(o)); isx2 (o) := not atom(isx2_(o)); isx2_body(o) := if isx2(o) then part(isx2_(o),1,2); sqrtp_ (o) := if isx2(o) then isx2_body(o) else sqrt(o); sqrtn_ (o) := if isx2(o) then -isx2_body(o) else sqrt(o); sqrtp (o) := map('sqrtp_,o); sqrtn (o) := map('sqrtn_,o); (x-2)^2+(y+3)^2=4; % - (x-2)^2; sqrtp(%); % - 3; (x-2)^2+(y+3)^2=4; % - (x-2)^2; sqrtn(%); - %; % - 3; */