This repository has been archived by the owner on Mar 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Xiaochun Tong
committed
Nov 7, 2019
1 parent
237af3a
commit 71f5fe3
Showing
2 changed files
with
25 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
|
||
#include <api/math.hpp> | ||
|
||
namespace miyuki { | ||
|
||
inline Float CosTheta(const Vec3f &w) { return w.y; } | ||
inline Float AbsCosTheta(const Vec3f &w) { return std::abs(CosTheta(w)); } | ||
inline Float Cos2Theta(const Vec3f &w) { return w.y * w.y; } | ||
inline Float Sin2Theta(const Vec3f &w) { return 1 - Cos2Theta(w); } | ||
inline Float SinTheta(const Vec3f &w) { return std::sqrt(std::fmax(0.0f, Sin2Theta(w))); } | ||
inline Float Tan2Theta(const Vec3f &w) { return Sin2Theta(w) / Cos2Theta(w); } | ||
inline Float TanTheta(const Vec3f &w) { return std::sqrt(std::fmax(0.0f, Tan2Theta(w))); } | ||
inline bool SameHemisphere(const Vec3f &wo, const Vec3f &wi) { return wo.y * wi.y >= 0; } | ||
|
||
} // namespace miyuki |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters