robotomatic

u/robotomatic


r/react•
Is this a normal pattern? I am new to react and have been feeling my way through so far (with claude)

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <BusyProvider>
      <ErrorBoundary>
        <ToastProvider>
          <TransitionProvider>
            <OfflineProvider>
              <AuthProvider>
                <LayoutWrapper>{children}</LayoutWrapper>
              </AuthProvider>
            </OfflineProvider>
          </TransitionProvider>
          <ToastContainer />
        </ToastProvider>        
      </ErrorBoundary>
    </BusyProvider>
  );
219





I am working with JavaScript canvas, and trying to draw PART of a Quadradic curve.

My arc is defined by the points A, B, and C. I have a point on the curve, D

https://preview.redd.it/u9sf4jqujold1.png?width=917&format=png&auto=webp&s=83f6873ba4773f9cbb7f3de06eee40b639e4ee8b

I want to make an arc between points A, X, and D that maintains the same curvature (I basically want to split the arc in half)

https://preview.redd.it/4pz7zbxwjold1.png?width=917&format=png&auto=webp&s=768170ccfc991bb9f358d3bc5ab6b5ebbe79a961

How do I figure out point X?

I added the green vectors by eye...is there a way to derive the new control point with the information I have available?

16

r/learnjavascript•

I am working with JavaScript canvas, and trying to draw PART of a Quadradic curve.

My arc is defined by the points A, B, and C. I have an intersection point D

imgur

I want to make an arc between points A, X, and D that maintains the same curvature (I basically want to split the arc in half)

imgur

How do I figure out point X?

I added the green vectors by eye...is there a way to derive the new control point with the information I have available?

19

r/askmath•

Re-upload...I didn't explain the problem properly the first time...

I am working with JavaScript canvas, and trying to draw PART of a Quadradic curve.

My arc is defined by the points A, B, and C. I have an intersection point D

https://preview.redd.it/3226edm65old1.png?width=917&format=png&auto=webp&s=0dbd96acf60a66509c268bbc41babe82363b167a

I want to make an arc between points A, X, and D that maintains the same curvature (I basically want to split the arc in half)

https://preview.redd.it/gfv4tiab5old1.png?width=917&format=png&auto=webp&s=e3330bc73490149314bb0aaf098245dbacbb7867

How do I figure out point X?

I added the green vectors by eye...is there a way to derive the

25

r/askmath•

I hope this is the right sub. My question is programming related, but the answer is all Maths...

I am doing some Javascript Canvas stuff and I am kinda lost when it comes to Quadratic curves.

I have a start point (x, y), an end point, and a control point to define the curve. I also have a random point somewhere along the curve. I want to draw the curve from the start point, through the control point, but end at my arbitrary point instead of the original end point.

Everything I try gives me unwanted curls at the end, I assume because my control point has to change to match the new end point. Can anyone shed some insight?

130