Difference between revisions of "Advanced C++ Programming Tutorial 1"
From Chilipedia
(Created page with "In this video, we learn to draw straight lines (not homophobic) between any 2 points. == Homework == For the homework, solve the following math problems: # Plot the line y=(6...") |
|||
(15 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | In this video, we learn to draw straight lines (not homophobic) between any 2 points. | + | In this video, we learn to draw straight lines (not homophobic) between any 2 points. Seriously though, linear equations permeate pretty much all of the things, so you might as well invest some timemoneybucks into not being utter shit at them. |
+ | |||
+ | == Topics == | ||
+ | * Linear equations (y=mx+b) | ||
+ | * Line rasterization | ||
+ | |||
+ | == Video Timestamp Index == | ||
+ | [https://youtu.be/l-u6uxnOmH0 Tutorial 1] | ||
+ | |||
+ | == Links == | ||
+ | * Cool graphing tool: [https://www.desmos.com Desmos] | ||
+ | * [https://github.com/planetchili/advmath GitHub Repo (advmath)] | ||
== Homework == | == Homework == | ||
− | For the homework, solve the following math problems | + | For the homework, solve the following math problems. All the problems should be solved algebraically where possible (i.e. not by simply graphing and observing). Feel free to take a break or two along the way. |
− | # Plot the line y=(6/9)x+3 | + | |
+ | # Plot the line y=(6/9)x+3. | ||
# Determine whether the following points are on the line y=(6/9)x+3: | # Determine whether the following points are on the line y=(6/9)x+3: | ||
## (-2,1) | ## (-2,1) | ||
## (3,5) | ## (3,5) | ||
− | # Find the point of intersection of the lines y=(6/9)x+3 and y=2x+7 | + | # Find the point of intersection of the lines y=(6/9)x+3 and y=2x+7. |
− | # Determine whether these two line segments intersect and where: (0,7)--(4,15) and (-6,-1)--(6,7) | + | # Determine whether these two line segments intersect and where: (0,7)--(4,15) and (-6,-1)--(6,7). |
− | # Find the equation of the line that is perpendicular to y=(6/9)x+3 and intersects it at x=3 | + | # Find the equation of the line that is perpendicular to y=(6/9)x+3 and intersects it at x=3. |
− | # Find the midpoint between (-5,-3) and (0,7) | + | # Find the midpoint between (-5,-3) and (0,7). |
− | # Find the perpendicular bisector line segment to make a "perfect X" with line segment (-5,-3)--(0,7) (here, perfect X means both line segments are same length) | + | # Find the perpendicular bisector line segment to make a "perfect X" with line segment (-5,-3)--(0,7) (here, perfect X means both line segments are same length). |
− | # Find the closest point on the line y=(6/9)x+3 to the point (5,2) | + | # Find the closest point on the line y=(6/9)x+3 to the point (5,2). |
− | # Find the distance between the point (5,2) and the line y=(6/9)x+3 | + | # Find the distance between the point (5,2) and the line y=(6/9)x+3. |
− | # Determine | + | # Determine whether the circle of radius 5 at (5,2) intersects with the line y=(6/9)x+3. |
+ | # Determine whether the circle of radius 5 at (5,2) intersects with the line segment (6,7)--(12,11). | ||
+ | # Find points of intersection between the circle of radius 5 at (5,2) and the line y=(6/9)x+3. | ||
+ | # Find the value that is 20% on the way from 4.2 to 6.9. | ||
+ | # Find the point that is 69% from (6,9) to (4,20). | ||
+ | # Find the color C3 that is a blend 69% from C1 (42,230,156) to C2 (200,60,200). | ||
+ | # You have a horizontal UI slider that has an x range of 223 to 273. It controls a strength value ranging from 5 to 100. | ||
+ | ## Find the mathematical function that computes the strength value given the x position of the slider. | ||
+ | ## The damage value for an attack is calculated as dmg=(3/2)str+10. Find the function that computes attack damage given the slider position. | ||
+ | |||
+ | === Solution Videos === | ||
+ | Since there is an asston of questions, I had to split up the solution into 4 motherfucking videos (you're welcome). | ||
+ | |||
+ | # [https://youtu.be/64oPt_-OxOQ Solutions: Q1-Q4] | ||
+ | # [https://youtu.be/qlsNNUN2RpA Solutions: Q5-Q8] | ||
+ | # [https://youtu.be/9RTegQGwXSA Solutions: Q9-Q12] | ||
+ | # [https://youtu.be/SNqqFdoKXJk Solutions: Q13-Q16] | ||
+ | |||
+ | == See also == | ||
+ | * [[Advanced C++ Programming Tutorial 2|Next in series (Tutorial 2)]] | ||
+ | * [[Advanced C++ Programming Series]] | ||
+ | * [[Intermediate C++ Game Programming Series]] |
Latest revision as of 00:00, 4 June 2018
In this video, we learn to draw straight lines (not homophobic) between any 2 points. Seriously though, linear equations permeate pretty much all of the things, so you might as well invest some timemoneybucks into not being utter shit at them.
Topics
- Linear equations (y=mx+b)
- Line rasterization
Video Timestamp Index
Links
- Cool graphing tool: Desmos
- GitHub Repo (advmath)
Homework
For the homework, solve the following math problems. All the problems should be solved algebraically where possible (i.e. not by simply graphing and observing). Feel free to take a break or two along the way.
- Plot the line y=(6/9)x+3.
- Determine whether the following points are on the line y=(6/9)x+3:
- (-2,1)
- (3,5)
- Find the point of intersection of the lines y=(6/9)x+3 and y=2x+7.
- Determine whether these two line segments intersect and where: (0,7)--(4,15) and (-6,-1)--(6,7).
- Find the equation of the line that is perpendicular to y=(6/9)x+3 and intersects it at x=3.
- Find the midpoint between (-5,-3) and (0,7).
- Find the perpendicular bisector line segment to make a "perfect X" with line segment (-5,-3)--(0,7) (here, perfect X means both line segments are same length).
- Find the closest point on the line y=(6/9)x+3 to the point (5,2).
- Find the distance between the point (5,2) and the line y=(6/9)x+3.
- Determine whether the circle of radius 5 at (5,2) intersects with the line y=(6/9)x+3.
- Determine whether the circle of radius 5 at (5,2) intersects with the line segment (6,7)--(12,11).
- Find points of intersection between the circle of radius 5 at (5,2) and the line y=(6/9)x+3.
- Find the value that is 20% on the way from 4.2 to 6.9.
- Find the point that is 69% from (6,9) to (4,20).
- Find the color C3 that is a blend 69% from C1 (42,230,156) to C2 (200,60,200).
- You have a horizontal UI slider that has an x range of 223 to 273. It controls a strength value ranging from 5 to 100.
- Find the mathematical function that computes the strength value given the x position of the slider.
- The damage value for an attack is calculated as dmg=(3/2)str+10. Find the function that computes attack damage given the slider position.
Solution Videos
Since there is an asston of questions, I had to split up the solution into 4 motherfucking videos (you're welcome).