Monthly Archives: July 2018

ArcType (quick and easy math authoring)

In 2015 I was writing lots of short recreational math documents. To aid myself in the creation of these, I built ArcType.

ArcType is a minimalistic editor that combines LaTeX, Markdown, HTML/CSS, gnuplot and Octave all in one place. A few months back I took ArcType and finalized it so that others could use it. It’s free and you can download your creations. Both the welcome screen and the helpfile cover most of the features available to you. Check it out here…

Here is a link to some of the docs I created…


It’s pretty self-explanatory - planning to do a tutorial about it soon. In the meantime, give this code a shot if you’re looking for more to play with than just the welcome/about demos.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Modified Bicuspid Curve
*by Zevan Rosser*
 
Original equation from somewhere on [this page](https://en.wikipedia.org/wiki/Quartic_plane_curve)
 
@@
(x^2 - a^2)(x - a)^2 + (y^2 - a^2)^2 = 0
@@
 
 
@@@@
%-> width: 70%; min-width: 300px;
a = 1.21;
lx = -2:0.1:2;
ly = -2:0.1:2;
[x,y] = meshgrid(lx, ly);
z = (x.^2 - a^2) .* (x - a).^2 + (y.^2 - a^2).^2;
 
contourf(x, y, z, -3.9:0.3:1, 'LineWidth', 0);
colormap(1 - gray);
axis([-1.5, 2, -2, 2]); 
@@@@

There’s only really one known issue on my radar - which is just the 5mb limit for localStorage… I’m sure there are other bugs - so if you decide to make something real with it - please save your work often ;)

If you have questions - feel free to post them here and I’ll do my best to respond.

Posted in Uncategorized | Leave a comment

Dynamic Getter

Getters in ES6 are usually defined within a class like this:

1
2
3
4
5
6
7
8
  class RandomPoint {
    get x() {
      return Math.random();
    }
    get y() {
      return Math.random();
    }
  }

In this case we use getters to make a random point:

  let pnt = new RandomPoint();
  console.log(pnt.x, pnt.y);
  // outputs something like 0.09403673512366306 0.2717692041118973

I found myself wanting to be able to dynamically define a getter. This can be done like this:

let rand = function() { return Math.random(); };
Object.defineProperties(someObj, { ['x']: { get: rand });

This is really all just sugar, but still fun stuff…

Posted in Uncategorized, javascript | Tagged , | Leave a comment

Bringing You Back To Life

So… for years I’ve left this blog alone as an archive of all my actionscript stuff. I moved over to zreference.com for a bit and then became so busy that I stopped blogging almost altogether. I still come back here probably once or twice a month to reference something… at least for me, this blog still has real value.

I’ve thought to myself so many times after spending hours solving something super confusing: “That would be a great post”. So… going to give it a shot - try and post things frequently here.

Snippets for now will mostly be in JavaScript and Objective-C/Swift since that’s what I’m using lately.

Posted in Announcements | Leave a comment