Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Center and Incircle formula not working
- Arzenist
-
98 posts
Center and Incircle formula not working
I used text book formulas and verified it on calculators, it doesn’t work 
https://scratch.mit.edu/projects/732151758/

https://scratch.mit.edu/projects/732151758/
- mlcreater
-
1000+ posts
Center and Incircle formula not working
Your script finds the I used text book formulas and verified it on calculators, it doesn’t work centroid of a triangle, which is the intersection of the three line segments with one end at a vertex and the other end at the midpoint of the opposite side, and is also the center of mass of a physical triangle.
https://scratch.mit.edu/projects/732151758/
You need to find the incenter, which is the center of the incircle (the circle tangent to every side), and is also the intersection of the three rays that bisect the interior angles of a triangle:
The centroid and incenter of a triangle are only the same point when the triangle is equilateral.
Also, “set pen size” sets the pen diameter, which is twice the radius, so once you are at the incenter you need to
- Arzenist
-
98 posts
Center and Incircle formula not working
Your script finds the I used text book formulas and verified it on calculators, it doesn’t work centroid of a triangle, which is the intersection of the three line segments with one end at a vertex and the other end at the midpoint of the opposite side, and is also the center of mass of a physical triangle.
https://scratch.mit.edu/projects/732151758/
You need to find the incenter, which is the center of the incircle (the circle tangent to every side), and is also the intersection of the three rays that bisect the interior angles of a triangle:
The centroid and incenter of a triangle are only the same point when the triangle is equilateral.
Also, “set pen size” sets the pen diameter, which is twice the radius, so once you are at the incenter you need to
Ah thanks
- Arzenist
-
98 posts
Center and Incircle formula not working
Your script finds the I used text book formulas and verified it on calculators, it doesn’t work centroid of a triangle, which is the intersection of the three line segments with one end at a vertex and the other end at the midpoint of the opposite side, and is also the center of mass of a physical triangle.
https://scratch.mit.edu/projects/732151758/
You need to find the incenter, which is the center of the incircle (the circle tangent to every side), and is also the intersection of the three rays that bisect the interior angles of a triangle:
The centroid and incenter of a triangle are only the same point when the triangle is equilateral.
Also, “set pen size” sets the pen diameter, which is twice the radius, so once you are at the incenter you need to
Ah thanks
https://turbowarp.org/733119336 not sure why the new formula is not working, it’s better but it messes up with offset, im pretty sure it’s right so I don’t know what I did wrong
Last edited by Arzenist (Sept. 16, 2022 23:18:42)
- mlcreater
-
1000+ posts
Center and Incircle formula not working
Right now it looks like the problem is with the order of the points in the x and y formulas.
A is the distance between 1 and 2, so it must be A * x/y pos of P3
B is the distance between 2 and 3, so it must be B * x/y pos of P1
C is the distance between 3 and 1, so it must be C * x/y pos of P2
A is the distance between 1 and 2, so it must be A * x/y pos of P3
B is the distance between 2 and 3, so it must be B * x/y pos of P1
C is the distance between 3 and 1, so it must be C * x/y pos of P2
- Xubse
-
7 posts
Center and Incircle formula not working
Hi, looking at this, what does S mean?
- mlcreater
-
1000+ posts
Center and Incircle formula not working
S is the semi-perimeter of the triangle, which is half of the sum of the side lengths. Hi, looking at this, what does S mean?
It seems I assumed that @Arzenist would understand this because their project set a variable S to this quantity.
A, B, and C were the distances between points 1 and 2, between points 2 and 3, and between points 3 and 1, respectively.
S*2 = A+B+C
- Xubse
-
7 posts
Center and Incircle formula not working
It seems to just go to the corner, am i dumb?S is the semi-perimeter of the triangle, which is half of the sum of the side lengths. Hi, looking at this, what does S mean?
It seems I assumed that @Arzenist would understand this because their project set a variable S to this quantity.
A, B, and C were the distances between points 1 and 2, between points 2 and 3, and between points 3 and 1, respectively.
S*2 = A+B+C
———————————————————–
https://scratch.mit.edu/projects/886648512/
go inside and run draw frame
Last edited by Xubse (Sept. 8, 2023 09:21:11)
- Xubse
-
7 posts
Center and Incircle formula not working

Last edited by Xubse (Sept. 8, 2023 09:23:38)
- Discussion Forums
- » Help with Scripts
-
» Center and Incircle formula not working