« first day (1345 days earlier)      last day (19 days later) » 

1:36 PM
Hello
I made a new porgram to rotate cartesian coordinates around the origin: Try it online!
I want to simplify the (⊂+/a×(⍴a)⍴1 2○⊃x)⍪⍨⊂-/a×(⍴a)⍴2 1○⊃x part to a shorter one, preferably
 
1:50 PM
@Razetime some reason you can't take the input as the head & tail separately?
(i still wish there was a simple atan2 in APL, and if BQN ever goes ahead with a trig namespace, i'm definitely having it there)
 
@dzaima 12○⊣+0J1×⊢ isn't so bad.
 
@Adám it's pretty bad.
@Razetime also, if using , you don't need the {…}1
 
@dzaima uh yes old question
doesn't have flexible input
 
@Razetime ah, understandable
 
is there a better way to rotate coordinates?
 
2:01 PM
@Razetime -1 by using in place of ↑…⊆
 
@dzaima doesn't seem to work.
 
@Razetime that's not all you have to do to make it work :p
 
ah
 
another -2 by using ×⍤1
 
@dzaima not sure where this one goes
 
2:10 PM
@Razetime to multiply each row of the reshaped tail by ⍵○⊃x you're reshaping it. Instead you could use ×⍤1 (just an example of how it works)
 
confusement
 
@Razetime ⍵○⊃x is a 2-item vector (i.e. 1 10 in my example); You want to multiply each row of a by it (4 2⍴⍳8 being a in my example)
 
ye it's just hard to find where it goes
never used atop a lot
 
@Razetime it's "rank" here. ×⍤1 is "apply × on cells with rank 1", aka multiply each row by the vector
 
2:18 PM
@Razetime yep! but (×⍤1)×⍤1⊢ for -1 byte
 
alright
68 bytes so far
would this be shorter with imaginary coordinates?
 
@Razetime i haven't tried; in the perfect world, (⊃x)0∘+⍢polar⊢⍬2⍴1↓x would work (i.e. "add (⊃x) to the angle in the polar coordinates)
 
@dzaima (fwiw i have an old file defining pol in dzaima/APL allowing for almost that (difference being it uses a vector of vectors instead of a matrix))
 
cool
I wasnt sure how to do it with a vector of vectors
 
2:24 PM
@Razetime you probably don't want to
 
2:37 PM
any better way to shorten this?
I feel like I'm done
 
@Razetime i have 53 using (⊣,',',⊢)/⍕¨ but a completely different approach to actually rotating (no temp function)
 
cool
I wanted to get it below 58
@dzaima you mean, not using g?
 
@Razetime yeah
 
oh, that's a whole rework
 
@Razetime yeah; (⊣,',',⊢)/⍕¨ is like the only thing left from your solution
 
2:45 PM
lol
 
@dzaima 51 by including x←⎕ in the expression instead of a separate statement
 
yeah now that you got rid of the function you can remove the global var
you may be able to shorten further with it
 
@Razetime definitely not what i had, but impressive regardless
 
oh well
 
@Razetime 47 with a different formatting strategy (no and but uses monadic )
 
3:00 PM
lemme try
 
@dzaima got mine to 47 too with another different formatting strategy; should probably be able to golf another byte or two off
 
Btw, webinar happing now at dyalog.tv
 
@dzaima yep, 46 but now it's a bit more confusing
 
ok lol
for now I'm gonna stop
 
3:29 PM
@dzaima got 43 by another slightly different method
 
@dzaima what a gamer
 
 
1 hour later…
4:44 PM
I'm trying to find the nth hilbert prime
but i need a workaround to assigning stuff in extended
 
5:13 PM
@Razetime i don't think you can without additional bytes. easiest would be ⍭⊢a←
 
5:40 PM
@dzaima (but that's only usable for function variables, and in most cases you'd want arrays)
 

« first day (1345 days earlier)      last day (19 days later) »