{"id":23066471,"url":"https://github.com/xjine/unity_mathcginc","last_synced_at":"2025-07-29T03:43:47.541Z","repository":{"id":83606985,"uuid":"197720705","full_name":"XJINE/Unity_MathCginc","owner":"XJINE","description":"Math.cginc includes some defined values and functions about math.","archived":false,"fork":false,"pushed_at":"2019-11-06T04:20:06.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T22:28:13.399Z","etag":null,"topics":["assets","shader","unity"],"latest_commit_sha":null,"homepage":"","language":"HLSL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XJINE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-19T07:06:49.000Z","updated_at":"2022-04-20T17:27:23.000Z","dependencies_parsed_at":"2023-07-08T19:16:09.356Z","dependency_job_id":null,"html_url":"https://github.com/XJINE/Unity_MathCginc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XJINE%2FUnity_MathCginc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XJINE%2FUnity_MathCginc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XJINE%2FUnity_MathCginc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XJINE%2FUnity_MathCginc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XJINE","download_url":"https://codeload.github.com/XJINE/Unity_MathCginc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246970322,"owners_count":20862509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assets","shader","unity"],"created_at":"2024-12-16T05:13:23.253Z","updated_at":"2025-04-03T09:12:53.924Z","avatar_url":"https://github.com/XJINE.png","language":"HLSL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unity_MathCginc\n\n``Math.cginc`` includes some defined values and some functions about math.\n\n\n## Import to Your Project\n\nYou can import this asset from UnityPackage.\n\n- [MathCginc.unitypackage](https://github.com/XJINE/Unity_MathCginc/blob/master/MathCginc.unitypackage)\n\n\n## Defines \u0026 Functions\n\n```hlsl\n#define MATH_PI          3.1415926\n#define MATH_2PI         6.2831852\n\n#define MATH_DEG_TO_RAD  0.0174533\n#define MATH_RAD_TO_DEG 57.2957795\n\n#define MATH_RAD_15      0.2617993\n#define MATH_RAD_30      0.5235987\n#define MATH_RAD_45      0.7853981\n#define MATH_RAD_60      1.0471975\n#define MATH_RAD_90      1.5707963\n#define MATH_RAD_120     2.0943951\n#define MATH_RAD_135     2.3561944\n#define MATH_RAD_150     2.6179938\n\n#define MATH_HALF        0.5\n#define MATH_QUATER      0.25\n#define MATH_ONE_THIRD   0.3333333\n#define MATH_TWO_THIRD   0.6666666\n#define MATH_ONE_SIXTH   0.1666666\n\nfloat3x3 RotationMatrixAxis(float radian, float3 axis)\nfloat3x3 RotationMatrixX(float radian)\nfloat3x3 RotationMatrixY(float radian)\nfloat3x3 RotationMatrixZ(float radian)\nfloat DegreeToRadian(float degree)\nfloat RadianToDegree(float radian)\nfloat Random(float2 uv)\nfloat Random(float2 uv, int seed)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxjine%2Funity_mathcginc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxjine%2Funity_mathcginc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxjine%2Funity_mathcginc/lists"}