RD> I want to construct and plot a Squircle in J. [...]
RD>
RD> Has anyone a good idea for performing that calculation? Could the J
RD> function plot then draw the Squircle?
It is easy to "plot" parametric functions in the complex plane.
Here are three parametric functions, to
I think you've already explained this, but I don't recall why x and y
should have special status in global namespace. Perhaps I need to study
the current documentation and release notes?
$ j
JVERSION
Engine: j904/j64avx2/linux
Beta-e: commercial/2022-07-16T19:24:59
Library: 9.04.01
Platform
The names mnuvxy have always been special, giving value error if they
are not defined. I'm not sure that's necessary now, but that's how it is.
The reason for having undefined names stack a reference is so that you
can have recursive definitions. The need for that is less with mnuvxy.
Henry
On Tue, Aug 16, 2022 at 2:09 PM wrote:
> circle =. cos j. sin
> square =. cos j.&* sin
>
> squircle =. (square + circle) % 2: NB. your "mean" of the functions.
I thought of trying that, but... it leaves out the "closest distance" part.
Perhaps the thought would have been that for each rad
And the visualisation part (mostly just getting a screenful of normalised
coordinates to apply to):
' #' {~ 0 >: sdsquircle"1] 25 50 %"1~ _25 _50 +"1] ($ (#: i.@(*/))) 51 101
Ratio of 50 to 100 just accounts for aspect ratio; should be 1:1 if working
with square pixels.
Also, sdsquircle _doe
On Tue, 16 Aug 2022, Raul Miller wrote:
"closest distance" part
That's exactly what my solution (howbeit apparently to the problem) does; see
my posting.
--
For information about J forums see http://www.jsoftware.com/forums.
A question to Raul please: I really liked your simplified approach to plot
against X^4 + y^4 <= 1 using:
require ‘viewmat’
viewmat 1>: +&|/~ ((i:300)%200)^4
But I noticed that since this is to the 4th power, why do you invoke +&| ?
I see the same result using:
viewmat 1>: +/~ ((i:300)
Ah, now I remember.
First, a little detail: when you have the name 'func' in a sentence, and
func is defined as a non-noun, what actually gets put onto the execution
stack is
'func'~
This is what we mean by a 'reference' to the name func. The reference
is a non-noun, and when it gets execu