Am I just poor at algebra? :)

So I am still messing around with the 7219, I have an axis (8 by 8) :slight_smile:
I thought in maths today, it would be pretty cool if could represent my homework to myself on the matrix(or this is just an excuse :wink: ). I nearly aced the y=mx + C. Just inputting a gradient and an intercept, this was pretty cool as you could make some cool patterns with just changing the intercept.

I then wanted to try and make circles on the display using the formula (x-a)^2 + (y-b)^2 = r^2 . Now because I just cycle through x we are really only finding the x value with a given mid point and radius (a and b and r).

Rearranging
(y-b)^2 = r^2 - (x-a)^2
square root
(y-b) = r - (x-a)
then finally
y= r - (x + a + b)

Hopefully this is wrong so It gives me somewhere to actually correct this, but when I tried It was extremely weird I am not to sure how to explain. But what I am really asking (even though this is a programming forum) Is my algebra correct? And do I need + and minus values?

:slight_smile: Hopefully everyone is with me, and could anyone suggest patterns for me to try? I was hoping to incorporate trig functions and create a moving AC wave but I wouldn't know where to start? BTW I have complete C1 and doing C2 so this is why I am using these formulas.

Thank you to all those who suggest things, and Ill post a video when I get something a little 'neater' working, for now I might just make some Serial UI and display the Graph or something. Thanks again!
Trevor Boultwood.

Rearranging
(y-b)^2 = r^2 - (x-a)^2

Yes.

square root
(y-b) = r - (x-a)

Definitely not.
You can't take the square root of the individual terms on the RHS.

(y-b)^2 = r^2 - (x-a)^2
and then
y-b = sqrt(r^2 - (x-a)^2)
where the sqrt can be plus or minus.

Pete

To draw a circle, you can exploit symmetry, so for every point calculated, you can plot eight.
All you need to do is offset the centre of the circle.
Simplify to x2 + y2=r2, so forget a and b until you plot.

Try not to use the carat/circumflex - it is the XOR operator in C

Ohh! I see, so I can't square root everything separately? Hmm interesting! I am trying to imagine or work out what how I can do this symmetry thing? I kinda want to input values and then draw a circle from the center point and then the radius. I guess are you trying to suggest, to use this formula(I do recognize it) and then apply points within it? Thank you both for replying! :slight_smile:

Think about a circle drawn centred on the origin.
If you step along the x axis, you start at zero.
What then is the value of y?
If x = r, what is the value of y?
Symmetry about the two axes is easy to see, but there's symmetry at 45 degrees too.

Ohhhh! I totally understand now! That makes a lot of sense, and it easier to implement! I might try you method right now, The only problem, Is that I have 1 matrix so I would have to change the axis to like 4x4 grids, which is a little small, Ill see what I can do, I haven't tried adding more displays, I might have to try daisy chaining them. Thank you again! Hmmm! I will have the think this through! Thanks!

TrevorBoultwood