Skip to content

Commit bf4d41b

Browse files
committed
run v fmt basicgm.v
1 parent 63afd84 commit bf4d41b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

gm/basicgm.v

+12-12
Original file line numberDiff line numberDiff line change
@@ -166,33 +166,33 @@ pub fn is_point_in_line(p &Point, a &Point, b &Point, zero f64, told f64, tolin
166166

167167
// pythagorean_theorem calculates the length of the hypotenuse given the lengths of the other two sides
168168
pub fn pythagorean_theorem(a f64, b f64) f64 {
169-
return math.sqrt(a * a + b * b)
169+
return math.sqrt(a * a + b * b)
170170
}
171171

172172
// euclidean_theorem calculates the lengths of segments created by the altitude to the hypotenuse
173173
pub fn euclidean_theorem(a f64, b f64, c f64) (f64, f64) {
174-
h := (a * b) / c
175-
p := (h * h) / a
176-
q := (h * h) / b
177-
return p, q
174+
h := (a * b) / c
175+
p := (h * h) / a
176+
q := (h * h) / b
177+
return p, q
178178
}
179179

180180
// triangle_area_sine calculates the area of a triangle given two sides and the angle between them
181181
pub fn triangle_area_sine(a f64, b f64, angle_rad f64) f64 {
182-
return 0.5 * a * b * math.sin(angle_rad)
182+
return 0.5 * a * b * math.sin(angle_rad)
183183
}
184184

185185
// triangle_missing_side calculates the length of the missing side of a triangle
186186
// given two sides and the angle between them
187187
pub fn triangle_missing_side(a f64, b f64, angle_rad f64) f64 {
188-
return math.sqrt(a * a + b * b - 2 * a * b * math.cos(angle_rad))
188+
return math.sqrt(a * a + b * b - 2 * a * b * math.cos(angle_rad))
189189
}
190190

191191
// triangle_area_from_points calculates the area of a triangle given its three vertices
192192
pub fn triangle_area_from_points(p1 &Point, p2 &Point, p3 &Point) f64 {
193-
a := dist_point_point(p1, p2)
194-
b := dist_point_point(p2, p3)
195-
c := dist_point_point(p3, p1)
196-
s := (a + b + c) / 2 // semi-perimeter
197-
return math.sqrt(s * (s - a) * (s - b) * (s - c))
193+
a := dist_point_point(p1, p2)
194+
b := dist_point_point(p2, p3)
195+
c := dist_point_point(p3, p1)
196+
s := (a + b + c) / 2 // semi-perimeter
197+
return math.sqrt(s * (s - a) * (s - b) * (s - c))
198198
}

0 commit comments

Comments
 (0)