tikz-坐标平移

关键字:xshift,yshift,shift

要点:
- 如果xshift或yshift的偏移量值为0,则可以省略。
- 如果x或y方向上某个值为0,则shift可以用更易读的xshift或yshift代替。
- shfit后面的参数要用花括号括起来

这里以正六边形为例,代码:

\begin{tikzpicture}[scale=1]

\coordinate (P1) at (1,0);
\coordinate (P2) at ([shift={+(120:1cm)}] P1);
\coordinate (P3) at ([shift={+(-1,0)}] P2);
\coordinate (P4) at ([shift={+(240:1cm)}] P3);
\coordinate (P5) at ([shift={+(300:1cm)}] P4);
\coordinate (P6) at ([xshift=1cm, yshift=0] P5);

\draw (P1)node [right]{P1}
      --(P2)node [above right]{P2}
      --(P3)node [above left]{P3}
      --(P4)node [left]{P4}
      --(P5)node [below left]{P5}
      --(P6)node [below right]{P6}
      --cycle;

\end{tikzpicture}

效果:

这里写图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值