지붕 관련 수치 추가

This commit is contained in:
hyojun.choi 2024-07-10 10:29:32 +09:00
parent 88a8900512
commit 0c9ba38209

View File

@ -178,7 +178,6 @@ export const rearrangeArray = (array, index) => {
return fromIndexToEnd.concat(fromStartToIndex)
}
export const findTopTwoIndexesByDistance = (objArr) => {
if (objArr.length < 2) {
return [] // 배열의 길이가 2보다 작으면 빈 배열 반환
@ -204,4 +203,25 @@ export const findTopTwoIndexesByDistance = (objArr) => {
}
return [firstIndex, secondIndex]
}
}
/**
* 지붕의 누워있는 높이
* @param base 밑변
* @param degree 각도 ex(4촌의 경우 21.8)
*/
export const getRoofHeight = (base, degree) => {
return base / Math.cos((degree * Math.PI) / 180)
}
/**
* 지붕 빗변의 길이
* @param base 밑변
*/
export const getRoofHypotenuse = (base) => {
return Math.sqrt(base * base * 2)
}
export const getDegreeByChon = (chon) => {
return chon * 5.45
}