CodingTrain / CodingTrain/Coding-Challenges

145_Ray_Casting - optimice performance by using square distance

未關閉
#15 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
189
分支
86
PR 合併指標
30 天內沒有已合併 PR

描述

when using dist only for compare, its better to use the `square distance`. Because otherwise quare-root needs to be calculated which is much more cpu heavy.

https://github.com/CodingTrain/Coding-Challenges/blob/2a9d68112b1aa80cbd5aa303f1d97dda7b045fde/145_Ray_Casting/P5/particle.js#L29

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

開啟 145_Ray_Casting/P5/particle.js 的第 29 行,檢查 dist 如何用於比較。更新比較邏輯以使用距離的平方,然後驗證 ray-casting 範例仍然選取相同的結果,且行為正確。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript
領域
computer-graphics
Issue 類型
重構
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。