mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
Update usages of obsolete rad2deg() and deg2rad() in docs
There were 4 pages documentation pages still using deg2rad(), which have been substituted by deg_to_rad() and the examples tested against 4.0.X. There was 1 usage of C# Deg2Rad(), now DegToRad(). Some dependent comments and output have been updated accordingly: (deg_to_rad() is implemented in the Math core functions, not in the Expressions class), plus some float precission fixes, at least on my architecture. Only one mention of rad2deg() was found in all docs. Fixes #7247
This commit is contained in:
@@ -227,7 +227,7 @@ In our example, we will simply use a fixed number of points, no matter the radiu
|
||||
var points_arc = PackedVector2Array()
|
||||
|
||||
for i in range(nb_points + 1):
|
||||
var angle_point = deg2rad(angle_from + i * (angle_to-angle_from) / nb_points - 90)
|
||||
var angle_point = deg_to_rad(angle_from + i * (angle_to-angle_from) / nb_points - 90)
|
||||
points_arc.push_back(center + Vector2(cos(angle_point), sin(angle_point)) * radius)
|
||||
|
||||
for index_point in range(nb_points):
|
||||
@@ -242,7 +242,7 @@ In our example, we will simply use a fixed number of points, no matter the radiu
|
||||
|
||||
for (int i = 0; i <= nbPoints; i++)
|
||||
{
|
||||
float anglePoint = Mathf.Deg2Rad(angleFrom + i * (angleTo - angleFrom) / nbPoints - 90f);
|
||||
float anglePoint = Mathf.DegToRad(angleFrom + i * (angleTo - angleFrom) / nbPoints - 90f);
|
||||
pointsArc[i] = center + new Vector2(Mathf.Cos(anglePoint), Mathf.Sin(anglePoint)) * radius;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user