Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
ken0225
RIS-Using-Dynamic-Rotations
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
RIS-Using-Dynamic-Rotations
/
function_theta_v2.m
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
42 lines (32 loc) · 1.45 KB
main
Breadcrumbs
RIS-Using-Dynamic-Rotations
/
function_theta_v2.m
Copy path
Top
File metadata and controls
Code
Blame
42 lines (32 loc) · 1.45 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function [output_function_theta_v2]=function_theta_v2(p_mn, p_BS)
% Author: Ke(Ken)WANG from Macao Polytechnic Institute
% Email: ke.wang@ipm.edu.mo, kewang0225@gmail.com
% Update infomation: v0.1(2020/11/19), v0.4(2022/04/30)
%
% This function aims to calculate the polar angle $\theta_T$ and $\theta_R(t)$.
% Please refer to the content below the eq(7) in GC2021 paper.
%
% License: This code is licensed under the GPLv2 license. If you in any way
% use this code for research that results in publications, please cite our
% original article.
%
% Example:
%
% p_BS = [-1,0,-1]; p_mn= [1,0,0]; [output_function_theta]=function_theta_v2(p_mn, p_BS)
% p_BS = [-1,0,-1]; p_mn= [1,0,0]; [output_function_theta]=function_theta(p_mn, p_BS)
%Check the inputs are suitable or not
if ismatrix(p_mn) && ismatrix(p_BS)
p_mn = function_check_dim(p_mn);
p_BS = function_check_dim(p_BS);
else
error('Please note that only the matrix is supported.')
end
p_mn_2d = [p_mn(1), p_mn(3)];
p_BS_2d = [p_BS(1), p_BS(3)];
y=@(x)((p_BS(3)-p_mn(3))/(p_BS(1)-p_mn(1)))*(x-p_mn(1)) + p_mn(3);
temp_y = y(0);
a = norm(p_mn_2d-[0,0]); b = norm([0,temp_y]-[0,0]); c = norm([0,temp_y]-p_mn_2d);
% Now we know the length of the three sides of the triangle, then we
% calculate the angle
output_function_theta_v2=pi/2 - acos((a^2+c^2-b^2)/(2*a*c));
end
You can’t perform that action at this time.