Learn Encapsulation by Building a Projectile Trajectory Calculator - Step 21

You tell me, do you understand all of this code?

finds the maximum val of x axis, you need this due to the fact that the x axis is based off the number of ticks, you don’t need to do this with y axis because the y axis is already established at each line of the new row

What does this line do?

max_x = max(x for x, y in coordinates)

i don’t know why my reply never responded to you

try again? post again your answer?

yeah i know its above his reply ill respond to it

this one…,;;,;;,;,;,;,;,;;,;,;;,;,;,;,;,;,;;,;,;,;,;,;,;;,;,;,;,;

this finds the maximum val of x axis, you need this due to the fact that the x axis is based off the number of ticks, you don’t need to do this with y axis because the y axis is already established at each line of the new row

and where are you taking the values of the X from?

the x_axis_tick is the value of the x axis, the x is the expression you want to iterate over, the coordinate tuple you are trying to find the max for is in the form (x,y) in this cooridnate you are just trying to find the x axis as the symbol x_axis_tick is for the x axis

What does this line of code do?

I am asking, what set of coordinates are you taking the x value from?

matrix_list, is the set of coorindates it is taken from

no, it’s not, your line is max_x = max(x for x, y in coordinates), no matrix_list here

i’m overthinking this that code is saying for each coordinate in coordinate take out the x coordinate, so the answer would be coordiantes

but what is coordinates? is it something from the class?

okay so this part max(rounded_coords) tells us to find the maximum value in the list, but we need to tell it what largest actually means as cooridnate is 2 group of numbers, so we tell add on this part key=lambda i: i[0])[0] saying for the first value in that coorindate and the 0 at the end is just there to return the largest value itself

self._coordinates thats where at the start of the code it comes from the calculate_all_coordinates

that is not coordinates, that is self.__coordinates

yeah i changed it it was wrong, i don’t know how it worked tho