@@ -1221,7 +1221,7 @@ function compute_thermal_structure(Temp, X, Y, Z, Phase, s::SpreadingRateTemp, s
12211221 Distance = perpendicular_distance_to_segment (px, py, x1, y1, x2, y2)
12221222
12231223 # Calculate thermal age
1224- ThermalAge = abs (Distance * 1e3 * 1e2 ) / SpreadingVel + AgeRidge * 1e6 # Thermal age in years
1224+ ThermalAge = abs (Distance * 1e5 ) / SpreadingVel + AgeRidge * 1e6 # Thermal age in years
12251225 if ThermalAge > maxAge * 1e6
12261226 ThermalAge = maxAge * 1e6
12271227 end
@@ -1251,11 +1251,7 @@ end
12511251# Function to determine the side of a point with respect to a line (adjusted for segment direction)
12521252function side_of_line (x, y, x1, y1, x2, y2, direction)
12531253 side = (x2 - x1) * (y - y1) - (y2 - y1) * (x - x1)
1254- if direction == :left
1255- return side > 0
1256- else
1257- return side < 0
1258- end
1254+ direction == :left ? side > 0 : side < 0
12591255end
12601256
12611257# Function to determine in which region a point lies (based on delimiters)
@@ -1265,11 +1261,7 @@ function determine_region(px, py, delimiters, segments)
12651261 x2, y2 = delimiters[i][2 ]
12661262
12671263 # Determine the direction of the segments
1268- if x2 < x1
1269- direction = :left # Shift left
1270- else
1271- direction = :right # Shift to the right
1272- end
1264+ direction = x2 < x1 ? :left : :right
12731265
12741266 # Check the side of the line considering the direction
12751267 if side_of_line (px, py, x1, y1, x2, y2, direction)
0 commit comments