tikz画GPS卫星电文通信结构图

tikz画GPS卫星电文通信结构图_第1张图片
老师说这样可以。
TeX代码如下,直接在tikz文档里面搜索函数学习即可,我都看不懂。代码仅供参考。
zhb希望大家除了能学到具体用法,还能通过代码学习绘图思路。同时也希望上交的作业不要完全照搬。 (=´ω`=)

\documentclass[tikz,border=3.14mm]{
     standalone}
\begin{
     document} 
\begin{
     tikzpicture}
\usetikzlibrary[positioning]
\usetikzlibrary {
     calc}
\usetikzlibrary {
     arrows.meta}
\usetikzlibrary {
     shapes.geometric}
\node at (-7.2,6.5) {
     \fontsize{
     30pt}{
     20pt}\textbf{
     H.B.}};

\node (head) [shape aspect=1.5,diamond,draw,line width=3pt,blue,align=center,font=\bfseries,inner sep=0] at (0,5.5) {
     \huge navigation\\\huge message};
\draw [-Stealth,line width=1.5,blue] ($(head.west)+(-0.1cm,0)$)--++(-0.5cm,0)--++(-140:4);
\draw [-Stealth,line width=1.5,blue] ($(head.east)+(0.1cm,0)$)--++(0.5cm,0)--++(-40:4);
\draw[thick,color=blue,domain=-7.5:-4.5,samples=500] plot (\x,{
     0.5*sin(4.19*\x r)-15.0});
\draw[thick,color=blue,domain=-1.5:0,samples=500] plot (\x,{
     0.5*sin(4.19*\x r)-15.0});
\draw[thick,color=blue,domain=6:7.5,samples=500] plot (\x,{
     0.5*sin(4.19*\x r)-15.0});


\begin{
     scope}[row sep=2cm,column sep=-.36]
\matrix [nodes=draw,minimum height=0.5cm,minimum width=3cm]
{
     
  \node (frame){
     Frame 1}; & \node (frame2)[fill=red!30]{
     Frame 2}; & \node {
     \LARGE{
     $\cdots$}}; & \node {
     Frame 24}; & \node {
     Frame 25};\\
  \node (subframe){
     Subframe 1}; & \node (subframe2)[fill=red!30]{
     Subframe 2}; & \node {
     Subframe 3}; & \node {
     Subframe 4}; & \node (subframe5){
     Subframe 5};\\
};
\matrix [nodes=draw,minimum height=0.5cm,minimum width=1.5cm] at (0,-3.75)
{
     
  \node (word){
     TLM}; & \node {
     HOW}; & \node (word3)[fill=red!30]{
     Word 3}; & \node {
     Word 4}; & \node {
     Word 5}; & \node {
     Word 6}; & \node {
     Word 7}; & \node {
     Word 8}; & \node {
     Word 9}; & \node (word10){
     Word 10}; \\
};
\matrix [nodes=draw,minimum height=0.5cm,minimum width=1.5cm] at (0,-6.25)
{
     
  \node (bit){
     bit 1}; & \node {
     bit 2}; & \node [minimum width=3cm] {
     \LARGE{
     $\cdots$}}; & \node (biti)[fill=red!30]{
     bit i}; & \node [minimum width=6cm] {
     \LARGE{
     $\cdots$}}; & \node (bit30){
     bit 30};\\
};
\matrix [nodes=draw,minimum height=1cm,minimum width=1.5cm,align=center,font=\scriptsize] at (0,-10.5)
{
     
  \node (caperiod){
     C/A \\Period 1}; & \node {
     C/A \\Period 2}; & \node [minimum width=3cm] {
     \LARGE{
     $\cdots$}}; & \node (caperiodi)[fill=red!30]{
     C/A \\Period i}; & \node [minimum width=6cm] {
     \LARGE{
     $\cdots$}}; & \node (caperiod20){
     C/A \\Period 20};\\
  \node (cachip){
     C/A \\Chip 1}; & \node {
     C/A \\Chip 2}; & \node [minimum width=3cm] {
     \LARGE{
     $\cdots$}}; & \node (cachipi)[fill=red!30]{
     C/A \\Chip i}; & \node [minimum width=6.cm] {
     \LARGE{
     $\cdots$}}; & \node (cachip1023){
     C/A \\Chip 1023};\\
};
\matrix [nodes=draw,minimum height=1cm,minimum width=1.5cm,align=center,font=\Large,align=right] at (0,-15)
{
     
    \node (c1){
     }; & \node (c2){
     }; & \node [minimum width=3cm] {
     \LARGE{
     $\cdots$}}; & \node (ci){
     }; & \node [minimum width=6cm] {
     \LARGE{
     $\cdots$}}; & \node (c1540){
     };\\
};
\node [below left=0.06cm of c1.north east]{
     \Large{
     1}};
\node [below left=0.06cm of c2.north east]{
     \Large{
     2}};
\node [below left=0.06cm of ci.north east]{
     \Large{
     i}};
\node at ($(c2)+(12.35cm,0.2cm)$) {
     \normalsize{
     1540}};
\end{
     scope}

\newcommand\rowname[2]{
     \node [left = 0cm of #1.west] {
     #2};}
\newcommand\timewid[2]{
     \draw  ($(#1.north west)+(0,0.3cm)$)--++(15.02cm,0) node[midway,fill=white] {
     #2};}
\newcommand\aaa[1]{
     \node (#1a) [below=0cm of #1.south west]{
     };}
\newcommand\bbb[1]{
     \node (#1b) [below=0cm of #1.south east]{
     };}
\newcommand\getnode[1]{
     \aaa{
     #1}\bbb{
     #1}}
\newcommand\expandw[2]{
     \draw (#1)--++(0,-0.5cm)--($(#2.north west)+(0,0.45cm)$)--++(0,-0.35cm);}
\newcommand\expande[2]{
     \draw (#1)--++(0,-0.5cm)--($(#2.north east)+(0,0.45cm)$)--++(0,-0.35cm);}
\newcommand\expand[3]{
     \expandw{
     #1a}{
     #2}\expande{
     #1b}{
     #3}}

\rowname{
     frame}{
     Almanac}
\rowname{
     subframe}{
     Frame}
\rowname{
     word}{
     Subframe}
\rowname{
     bit}{
     Word}
\rowname{
     caperiod}{
     Bit}
\rowname{
     cachip}{
     C/A Period}
\rowname{
     c1}{
     C/A Chip}

\begin{
     scope}[>=Stealth,<->,line width=1.5,inner xsep=0.5cm]
  \timewid{
     frame}{
     12.5minutes = 25 frames}
  \timewid{
     subframe}{
     30 seconds = 5 subframes}
  \timewid{
     word}{
     6 seconds = 10words}
  \timewid{
     bit}{
     600 milliseconds = 30 bits}
  \timewid{
     caperiod}{
     20 milliseconds = 1 bit}
  \timewid{
     cachip}{
     1 millisecond = 1023 C/A Chips}
  \timewid{
     c1}{
     977.5 nanoseconds = 1540 L1}
\end{
     scope}

\getnode{
     frame2}
\getnode{
     subframe2}
\getnode{
     word3}
\getnode{
     biti}
\getnode{
     caperiodi}
\getnode{
     cachipi}

\begin{
     scope}[line width=1.5,red!50]
  \expand{
     frame2}{
     subframe}{
     subframe5}
  \expand{
     subframe2}{
     word}{
     word10}
  \expand{
     word3}{
     bit}{
     bit30}
  \expand{
     biti}{
     caperiod}{
     caperiod20}
  \expand{
     caperiodi}{
     cachip}{
     cachip1023}
  \expand{
     cachipi}{
     c1}{
     c1540}
\end{
     scope}

\end{
     tikzpicture}
\end{
     document}

zhbnb!

你可能感兴趣的:(latex,latex,tikz)