« first day (2761 days earlier)      last day (2409 days later) » 

user1596138
19:00
I made a washing machine but I'm still confused codesandbox.io/s/vv892ly2pl
user1596138
Least I can find generally what I'm looking for online now tho
user1596138
Thanks entity
user1596138
That dumb loop is just my attempt to place a shape on the majority of points around the shape for easier viewing
you're multiplying by 5 twice on the y
create more squares, and make them smaller
maybe color them with alpha, so you see the overlaps
user1596138
@towc Yea I started dicking around
19:02
@Jhawins Looks like someone forgot to use polar coordinates
also, you need to multiply a sin wave to the initial radius
those are called lissajous figures btw
then multiply that radius by the sin/cos of the radian
user1596138
@KendallFrey I don't understand what that even means yet
you're using 3 waves: one of them to modify the radius, and two to determine the x and y given the radius and radian
19:03
the easy calculation is to figure out the radius for a given angle, right?
that's just the formula I gave
then you have to convert radius,angle into x,y
@ndugger That is a wrong decision, but heh 😃 I did the same mistake, so ... you are gonna have a lot of fun!
which involves separate sin/cos
Coming back to Rust from C/C++ feels like coming back to US from TrollLand
user1596138
I was tyring to just do it with like intuitive maths
user1596138
19:05
function getDepth(currentAngle) {
    var radius = 100;
    var anglesInSection = 360/5;
    var roundedNear = roundToNearest(currentAngle, anglesInSection);
    if (roundedNear < currentAngle) {
      roundedNear *= 2
    }
    var stepSize = (radius / 2) / (anglesInSection / 2);
    return ???
}
@Jhawins Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
user1596138
roundedNear would be 72
Going to Rust (or any stricter language) from JavaScript feels like waking up, ah the wonderful dream with with unicorns and rainbows.
cap you are so slow lately
user1596138
@CapricaSix Shut up I deleted it
user1596138
19:06
So I was just gonna decide what to multiply the "step size" by so become lower in the first half of the "section" and higher in the second half
@Jhawins man what is that trying to do
user1596138
If that makes sense with what I was trying to say earlier
user1596138
Just decide how many steps I have to go higher/lower on the radius
user1596138
Every point there would be like 1.38 smaler radius for example
user1596138
So at 35 degrees you'd be at like -48 radius
user1596138
19:07
Lmfao see it was never going to work
user1596138
And then from 36 through 72 we'd be coming back to zero
my suggestion is to keep playing around until you figure out your own meaning for what you're doing
user1596138
And then repeating. Idk it seemed simple
if you have the time for that
user1596138
@towc There's no meaning
19:08
maths is fairly abstract, and can be hard to understand from what people around you say
user1596138
I was just going to cheat
user1596138
Basically do my normal cos/sin on different values for the radius
just like anything abstract, I personally re-interpret most things about math in my own understanding
user1596138
The output fo this would be what I use in

const x = this.props.pathRadius * Math.cos(((angle * 5) * Math.PI / 180)),
      y = this.props.pathRadius * Math.sin(((angle * 5) * Math.PI / 180) * 5); for the radius
but I needed to find my own meaning first
user1596138
19:09
That way I only do one cos/sin
how do I uninstall javascript from my project
user1596138
Idk I still think I can make it work since it's per-point
@Jhawins not how that works I'm afraid
you could, but it involves more trig than you need
user1596138
No trig.
user1596138
I'll post later, it will work
19:11
@Jhawins that looks like a Lissajous curve
@KendallFrey help me out here
he doesn't listen to me
judging by the formula
it's actually not, because of the last * 5
user1596138
@AndrasDeak Yea thats what I wanna do but I'm mobile now
I figured out what I was looking for
19:12
a friend?
You can easily model these shapes with an online spirograph
HA
user1596138
@towc Even if I remove that it's not gonna do shit
@Jhawins it will make it an actual lissajoux curve
successful joke @towc
user1596138
No that's a circle
user1596138
which is not what you want. But he was wrong anyway
oh wait, it's still a lissajoux curve
uh-oh
hide all evidence
user1596138
Looks like a circle to me
btw, circles are subsets of lissajoux
user1596138
19:13
Make it look like a star
yup
a very boring special case
user1596138
lmao I'll fuck with it later I gotta get home
CodeSandbox is a scary
> "CodeSandbox has been installed, now it works offline"
@ShrekOverflow service workers
I do know all it did is register a service worker
19:14
It's a progressive web app
but phrasing!
@Cereal not really
Those "work" offline
Even though all of them don't really work without the internet
@Jhawins model your shape with this seedcode.com/SpirographN/sgn.html
@Cereal Its not a PWA
I have PWAs enabled in Chrome Desktop it just opens the website and doesn't actually run as a PWA
@Jhawins the ratio of touching points of a Lissajous curve on the x/y sides gives you the ratio of the frequencies along x and y
user1596138
19:15
@forresthopkinsa we already figured out what I was trying to say lol
if you want something starlike, that has 2 points along x and 1 along y or something
I know, you got an image of the shape, but you can see the path better with a spirograph
@ShrekOverflow So do I
Oh you're right
it installs but just launches chrome
Yep
@Cereal I have been on bleeding edge of PWAs and their lack of a sane auth story
user1596138
I know you guys are trying but I don't understand most anything you've said LMFAO
19:16
The site I'm creating now works as a PWA, which is kind of cool because I didn't go in with that intention
user1596138
You can totally get through life without ever worrying about any of this
user1596138
Cause I have so far 😂
@Cereal Neat, how do you authenticate ?
if you can't lissajoux, your life must be a wreck
I don't think I can draw a star with a lissajous curve
19:20
@ShrekOverflow Login, server responds with a token. Store the token in local storage and include the token with all of the api requests
kicks them off if the token isn't valid
user1596138
I'm like one of those dudes that started JS 3 weeks ago and comes in here trying to use redux and react router
@Jhawins here's a gotcha possibly: sin and cos don't mix
user1596138
And everyone's like this guy is dense cause he doesn't even know what we're saying lmao
Hadn't used es20119283 or whatever it's called
Hadn't used react
So naturally I decided to write the new product in react
user1596138
Right and they go just use the did update lifecycle to change the ref and context
19:21
oops
I meant 4 weeks ago, didn't mean to delete
they did what
oh no
user1596138
Except you guys are like. Just use cos and sin and polar points and make a lissajoux curve. An I'm just like lmao okay...
oh, you're talking about them lol
we're saying your current code is making that curve. You don't want that curve
user1596138
I'm saying I'm as dumb about plotting these points as a jQiery spaghetti dev about using React
you want to separate polarization (the formula that gives you x and y from radius and radian), from changing the radius
user1596138
19:22
@towc see. I didn't realize that haha
@HatterisMad know anything about bikes?
user1596138
Are you telling me I'm not making a circle
user1596138
Cause I sure thought I done did a circle
Google is adding morse code to their "gboard" for android. I thought it was an extremely late april fools joke, but it's actually for accessibility for people who can't type regularly.
that's pretty cool
I like gboard. Autocorrect can be stupid sometimes but it's a good keyboard
19:24
@Jhawins you're combining multiple functions together
one of them "makes a circle" (polarization)
user1596138
How would you have made a simple circle?
user1596138
Serious question
there it is
user1596138
Nice.
19:26
That's so much math that I don't understand. Trig is so hard.
const polarToCarthesian = (radius, radian) => ({
  x: radius * Math.cos(radian),
  y: radius * Math.sin(radian)
});
@KendallFrey looking at that image I just realized: (r0 + sin(phi*5))*[cos/sin](phi), so a sine-modulated radius will do
or is that exactly what you did with those lambdas?
now you're spouting nonsense
I can't see the math from the JS
19:28
anyway @Jhawins, that function "makes a circle"
maybe put that somewhere
and use that in your code, instead of having your formula. It should help you keep track of what does what
don't modify it
except rename "radian" to "angle" or maybe "theta"
that might make him think it's degrees
and fix the "carthesian" typo
theta is too abstract for him, possibly
@KendallFrey I think how you spell the name depends on where you are
  calculatePositionOnCircle(angle) {
    const x = this.props.pathRadius * (1 + 0.2 * Math.sin(angle * 5 * Math.PI / 180)) * Math.cos(angle * Math.PI / 180),
      y = this.props.pathRadius * (1 + 0.2 * Math.sin(angle * 5 * Math.PI / 180)) * Math.sin(angle * Math.PI / 180);

    return { x: x, y: y};
  }
is that clearer now, @towc? ^
19:30
but apparently it is commonly Cartesian
huh
is onmouseover a vanila js thing?
edited @Jhawins's original
@AndrasDeak no
I also have a follow up vue question if we have any vue devs here
the *5 inside the modulated radius may be off
19:32
use variable names ffs
I don't know JS at all
same
fake it 'til you make it
@AndrasDeak are you here to learn JS?
no, just to annoy you
if you're here just to judge and confuse people, you can go do that somewhere else
19:33
...
user1596138
@ndugger at least it's not just me lol I feel fucking stupid here
you can abstract the trig away
user1596138
I'm just getting home hold up
const makeWave = t => Math.sin(t)
19:35
so helpful
then you can do
don't have to worry about trig if you just don't ever do front-end
that depends on your definition of front-end
const { x, y } = polarToCarthesian(radius * makeWave(angle * 5), angle)
19:36
and you're done
no trig to understand
also the thing of making it the right shape instead of petals
user1596138
@forresthopkinsa tbh you never have to worry about trig in front end.
OK, I checked. @Jhawins that should work too, the magic 0.2 should be changed for optimal wiggliness of the star
@towc *Cartesian, FTFY
damnit
and you can change makeWave to be Math.sin(t) / 2 + 1, for example, to get waves and not petals
@Jhawins ideally
19:38
really, there isn't much trig. You can abstract away the confusing part, like you normally do in programming
user1596138
Did anyone send anything in the last 20 that I should definitely see lol
user1596138
@AndrasDeak Whoa okay...
look at all my messages
they're all paramount to you reaching your goal (this is a joke)
@Jhawins towc's last few messages with code show how to do it nicely
@towc well, maybe a bit exaggerated
19:39
we make the same point: take a circle and put a wiggle on top of it by changing r(phi) = r0 + c*sin(phi*5)
but they are quite useful
user1596138
@AndrasDeak :shrug: what
@AndrasDeak you can't just use single-letter variables and expect them to mean something
they're not variables, they are quantities :(
@towc this is math, of course you can
2
19:40
@Jhawins you're drawing 5 periods of a sine wave, but you're drawing it along a circle rather than on a straight line
user1596138
So I stole towcs code and ended up at x: 0 y: 0
for where it starts?
or for every point?
user2620028
@William what kind of bikes
user1596138
EVery point
Because they used multicharacter variable names. That breaks math.
user1596138
19:43
  calculatePositionOnCircle(angle) {
    const polarToCarthesian = (radius, radian) => ({
      x: radius * Math.cos(radian),
      y: radius * Math.sin(radian)
    });
    const makeWave = t => Math.sin(t);
    const { x, y } = polarToCarthesian(this.props.radius * makeWave(angle * 5), angle)

    return { x, y};
  }
@towc you can only abstract it if you understand it, otherwise you'd have to pull in someone elses abstraction, and that can be a mess sometimes too
user1596138
THis is where I am. This isn't a "I will copy your working code and move on" question either, this is a learning excercise
user1596138
Hope nit's not coming out that way
@HatterisMad well Ia split between modding a mountain bike and buying a Omafiets Granny type bike
change makeWave to, say 100 + 50 * Math.sin(angle)
user1596138
19:44
WHat are 100 and 50
yeah, need a constant offset
the point is to help you understand where things come from
I like high gear ratios which eliminate granny bikes
4 mins ago, by Andras Deak
we make the same point: take a circle and put a wiggle on top of it by changing r(phi) = r0 + c*sin(phi*5)
and how trig isn't that problematic
19:44
100 is r0, 50 is c
@Jhawins average radius and amplitude of the wave
user2620028
@William uhhhh seems like what you want to do with it would be the deciding factor there bud lol
user1596138
YEah I want to step through this
once it works you'll get a better idea by tweaking values and seeing what happens
@HatterisMad I like high torque and want a chain guard to keep my clothes from getting dirty and a rack to hold my backpack/cargo. I think the rack can be installed aftermarket though
19:45
@KendallFrey or const makeWave = t => Math.sin(t) / 2 + 1
get your tiny-ass stars outta here /s
just casual biking nothing serious
user2620028
yeah im not a bicycle enthusiast
user1596138
@towc Still 0,0 all points :P
@Jhawins show me the codesandbox
user1596138
19:46
@KendallFrey Yea I know that's not the usual learning process for code tho lmao
the radius factor outside makeWave implies that the constant mean in makeWave should be 1
Yeah its funny I went to the bike shop and they don't have any like seriously 0 bikes with a chain guard
user2620028
@william honestly mountain bikes will usually have tons of gears so you will have as much torque as you want
user2620028
@william chain guard can be installed afterwards :/
19:46
not really
unless you plan to remove the gears
user1596138
This confuses me
user2620028
uhhhhh dude you can definitely install an aftermarket chain guard
user1596138
polarToCarthesian(this.props.radius * makeWave(angle * 5)
@Jhawins use pathRadius
this.props.pathRadius
user1596138
Oh jesus christ sorry
19:47
that was your variable
user1596138
const polarToCarthesian = (radius, radian) => ({
user1596138
This confused me cause this says radius is the input
user1596138
But I don't believe that's a radius?
also, do fix the typo. It's polarToCartesian
19:48
haha i found your problem
it's pathRadius not radius
@Jhawins it does take a radius as the input
not a complete cover but close I guess
that's a radius
@KendallFrey late bruv
it's a radius that depends on the angle, in other words r(phi), in other words what I posted two times already with single-character names
user1596138
sorry i was busy finding the problem
user1596138
Alright yea it works
yeah I don't think "carthesian" is a geographical thing
now, dissect it, play around with it, get rid of the abstractions if you want
Cartesian as in _Des_cartes
19:49
mhm
user1596138
But wait why aren't my points in order
@Jhawins which order?
user1596138
Like if I plot angles 0-180, I end up with random looking points
user1596138
Why aren't I getting them 1 after another?
19:50
@HatterisMad there is a still a possibility your clothes will get dirty with everyone I have sen
chains have oil obvisouly
@Jhawins my functions use radians
user1596138
For example. In this I am plotting 0-180
user1596138
Right right right
user2620028
19:50
@William is that seriously what you are worried about? oil from the chain getting on your clothes?
you should plot 0-tau (0-6.283185307179586476925...)
user1596138
Ran into this already lmao
user1596138
@towc Fuckin wat
ew tau
anybody have used "rimraf" to delete folder and did it but make a file Damaged
19:51
@MahmoudNiypoo Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
@Jhawins radians, not degrees
@Jhawins tau = 2 * pi
user2620028
@william should be more worried about road debris making you dirty than your chain man
@KendallFrey you're slow today. Don't tell me you have actual things to do, unlike me
@HatterisMad that is probably a fair point. Just depends where you are biking
1 I can prevent the other not so much
19:51
@towc did you say anything about radians or degrees?
1 min ago, by towc
@Jhawins my functions use radians
user1596138
Don't I just do angle * (180 / Math.PI)
user1596138
Other way
protip: don't even bother with degrees
@Jhawins that's the same as plotting 0-pi. But sure, the way I said it might not have been very clear
and what kendall said
19:52
Do Tau
user2620028
@William but chain guards are to keep your pants out of the gear so you don't rip your pants, not keep them clean lol
!!> Math.TAU
@KendallFrey "ReferenceError: TAU is not defined"
@KendallFrey "undefined"
@KendallFrey want to champion adding TAU to Math as a proposal with me?
user1596138
19:53
How many radians in a circle
@Jhawins tau
user1596138
Lmao
2 * pi
@HatterisMad look at dutch bikes images-na.ssl-images-amazon.com/images/I/…
not reallu
19:53
6.28318530717958647692...
I mean it would do both
user1596138
This is why I fucking hate shapes
no, you hate pi
the standard should be tau
user1596138
How tf do I increment a radian between 0 and.. That lmao
by using floats
user2620028
19:54
@william honestly just get like a semi circle guard to cover the front gear
@Jhawins Math.PI * 0.001
+= that instead of ++
as an example
const increment = tau / 1000;
let i = 0;
while(i < tau) { i += increment; ... }
user1596138
Oh that makes sense
btw, this convo reminded me of something I imagine will play an important part in my life
user1596138
I don't understand this but it's dope af
19:57
I'm not a dev. I don't enjoy building products. I enjoy looking for solutions to problems with a certain set of variables and fairly well defined rules
user1596138
Lmao I will just have to sit and read a bit
I think I might go to uni, switch from CS to maths, and either do research or (I will likely regret this) teach it
user1596138
Dis what we made lol I wanted that exactly, to see it go around the path
@Jhawins look at this pen again 😛 codepen.io/towc/pen/OgWeXw?editors=0010
user1596138
19:59
Thanks for helps I'll try to understand this for real, this will help a lot having an example
do you see the resemblance now?
user1596138
@towc It was just too slow to notice lol
I added some more functions controlling for time, for example, kind of
making graphics and mathsy things involves a lot of composing things together like this

« first day (2761 days earlier)      last day (2409 days later) »