# Question about Direction Cosine Matrix

#### stiltz

Hi Everyone,

I am facing a basic level problem about direction cosine matrix as I am not an expert in mathmatics. Hope you people will help me..

I am working on inertial navigation system in three coordinate frames :
1. ENU
2. ECEF (XYZ)
3. LLH (Latitude , Longitude , Height)

I want to convert a point in LLH to ENU using Direction Cosine Matrix(from earth to enu frame)

I have written a piece of code in MATLAB:

enu_orig = [45 0 0]*pi/180; % origin of ENU frame expressed in LLH frame
enu_orig1 = llh2xyz(enu_orig); % origin of ENU frame expressed in XYZ frame

enu = [10 100 0]; % Reference point in ENU frame
xyz = enu2xyz(enu , enu_orig1); % convert to XYZ frame

llh = xyz2llh(xyz); % Convert to LLH frame
dcm = llw2dcm(llh); % Find the Direction Cosine Matrix relating Earth Frame (LLH) to ENU

enu1 = dcm * xyz; % Convert the point back to ENU using DCM

My problem is that :
Can I use DCM in this way for conversion from LLH to ENU frame. If yes then in the above code 'enu' and 'enu1' must be equal. But they are not in my case.

If I can not use DCM then what is the basic purpose of DCM ?

Hope it will be clear ...

Thanks
n Reqards

Athar Khan

Related Linear and Abstract Algebra News on Phys.org

Mentor
2018 Award

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving