当前位置:网站首页>Tikz learning notes (IV) further exploration of circle and complex geometry
Tikz learning notes (IV) further exploration of circle and complex geometry
2022-06-22 07:07:00 【zorchp】
Write it at the front
I introduced some basic graphics , The marking and intersection of the graph and some contents of the cycle , This time with the previous knowledge , You can create more complex graphics . Now let's introduce a simple drawing technique , That is, according to the given point ( center of a circle ) And any point on the circle to draw the circle . Then we can draw some complicated figures according to this technique .
By reading this article , You should be able to draw the following figure

And then draw some more complicated geometric figures , However, the method introduced here is still complex , And then you can go through tikz-euclide Package for quick rendering .
Given the length of two points as radius, make a circle ( arc )
This is a method often used in drawing with ruler and gauge , This is especially true when taking an arc of a given length , So let's see what happens here tikz The basic syntax for drawing in
\path [name path=o1]
let
\p1=($ (A) - (B) $),
\n1={
veclen(\x1, \y1)}
in
(O) circle (\n1);
The above code means :
- Mark a circle
o1; - take
AAndBA vector formed by two points , Write it down as\p1; - utilize tikz Engine
veclenFunction calculationABThe length of , And remember to\n1; - Mark ( No drawing ) With
OFor the center of a circle ,ABA circle with a length of radius .
Through this code , It is convenient to draw the length given by two points as the radius , A circle centered on a given point .
similarly , If you need to draw an arc , You only need to modify the last line of code to achieve , Examples are as follows
\path [name path=o1]
let
\p1=($ (A) - (B) $),
\n1={
veclen(\x1, \y1)}
in
(O) arc (0:90:1);
The main function used here is still \path, So it will not be drawn , If you need to draw , Then you can add [draw] Parameters , Or use it directly \draw Function to complete .
A simple example : Drawing method of drawing regular pentagon with ruler and gauge
design sketch :

The code and comments are as follows : See my previous article for detailed drawing steps TikZ Drawing examples —— A ruler makes a picture : An approximate drawing of a regular pentagon inscribed in a circle _zorchp-CSDN Blog _ Draw a regular pentagon with a ruler and gauge .
\documentclass[tikz,border=3pt]{standalone}
\usetikzlibrary{calc}
\usetikzlibrary{intersections,through}
\begin{document}
\begin{tikzpicture}[]
% AB, CD Is the vertical centerline of the circle
\coordinate [label=below left:$A$] (A) at (0,0);
\coordinate [label=below right:$B$] (B) at (4,0);
\coordinate [label=above left:$C$] (C) at (2,2);
\coordinate [label=below right:$D$] (D) at (2,-2);
\coordinate [label=below right:$O$] (O) at (2,0);
\draw [name path=o] (O) circle (2);
\draw [densely dashed,-latex,name path=AB] ($(A)!-.1!(B)$) -- ($(A)!1.1!(B)$);
\draw [densely dashed,latex-,name path=CD] ($(C)!-.1!(D)$) -- ($(C)!1.1!(D)$);
\coordinate [label=below:$H$] (H) at ($(O)!.5!(B)$);
% Mark the arc segment
\path [name path=o1]
let
\p1=($ (H) - (C) $),
\n2={veclen(\x1, \y1)}
in
(H) circle (\n2);
% Find the intersection G
\path [name intersections={of=o1 and AB}]
coordinate [label=below right:$G$] (G) at (intersection-1);
\draw (G) -- (C);
\draw [-latex] (H) -- ($(H)!1.18!($(C)!.5!(G)$)$);
% Draw arc segments
\draw [red]
let
\p1=($ (H) - (C) $),
\n2={veclen(\x1, \y1)}
in
(G) arc (180:110:\n2)
(G) arc (180:185:\n2);
% Find other points
\path [name path=o2]
let
\p2=($ (G) - (C) $),
\n2={veclen(\x2,\y2)}
in
(C) circle (\n2);
\path [name intersections={of=o2 and o}]
coordinate [label=above left:$E$] (E) at (intersection-1);
\path [name path=o3]
let
\p2=($ (G) - (C) $),
\n2={veclen(\x2,\y2)}
in
(E) circle (\n2);
\path [name intersections={of=o3 and o}]
coordinate [] (F) at (intersection-2);
\path [name path=o4]
let
\p2=($ (G) - (C) $),
\n2={veclen(\x2,\y2)}
in
(F) circle (\n2);
\path [name intersections={of=o4 and o}]
coordinate [] (J) at (intersection-2);
\path [name path=o5]
let
\p2=($ (G) - (C) $),
\n2={veclen(\x2,\y2)}
in
(J) circle (\n2);
\path [name intersections={of=o5 and o}]
coordinate [] (K) at (intersection-1);
% Draw a regular pentagon
\draw [thick] (C) -- (E) -- (F) -- (J) -- (K) -- cycle;
\end{tikzpicture}
\end{document}
The following points need to be paid attention to :
- Two arc segment ( Complete by marking the circle ) The point of intersection needs to pay attention to whether it is the first or the second point of intersection ;
- When drawing an arc, you should pay attention to the initial angle , And fine adjustment of arc parameters ;
- Give an appropriate alias , To prevent confusion caused by too many parts at the end of the painting .
边栏推荐
- [out of distribution detection] learning confidence for out of distribution detection in neural networks arXiv '18
- Protection of RT thread critical section
- Custom implementation of bind method in JS
- sessionStorage 和 localStorage 的使用
- Site pre cache code
- Rebuild binary tree
- buuctf部分题目wp
- 6. 安装ssh连接工具(用于我们连接实验室的服务器)
- Use of the thrust Library in CUDA
- Developing a contract application with low code
猜你喜欢

Kinect azure based multi camera data collection (I)

Tpflow v6.0.6 official release

【GCN-RS】UltraGCN: Ultra Simplification of Graph Convolutional Networks for Recommendation (CIKM‘21)

33岁程序员的年中总结

sessionStorage 和 localStorage 的使用
![[anomaly detection] malware detection: mamadroid (dnss 2017)](/img/dd/37a443fce627f7f38e3fe1767cb10e.jpg)
[anomaly detection] malware detection: mamadroid (dnss 2017)

OpenGL - Draw Triangle

Up sampling and down sampling (notes, for personal use)

MySQL面试真题(十八)——经营分析实战
![[Gan] Introduction to Gan basics and dcgan](/img/93/f0287f93283707b7082630cb89daf1.jpg)
[Gan] Introduction to Gan basics and dcgan
随机推荐
咖啡供应链是如何被趟平的?
Thousands of sails pass by the side of the sunken boat, and thousands of trees spring before the diseased tree
[out of distribution detection] deep analog detection with outlier exposure ICLR '19
Résumé semestriel du programmeur de 33 ans
golang调用sdl2,播放pcm音频,报错signal arrived during external code execution。
Kinect azure based multi camera data collection (I)
Introduction and use of cookies
编程题:移除数组中的元素(JS实现)
RT-Thread临界段的保护
JS中控制对象的访问
[Gan] Introduction to Gan basics and dcgan
【GCN-RS】UltraGCN: Ultra Simplification of Graph Convolutional Networks for Recommendation (CIKM‘21)
Assembly learning Chapter 4 of assembly language (Third Edition) written by Wang Shuang
MySQL面试真题(十八)——经营分析实战
[outside distribution detection] your classifier is secret an energy based model and you head treat it like one ICLR '20
JS中如何阻止事件的传播
Detailed tutorial on connecting MySQL with tableau
【GAN】《ENERGY-BASED GENERATIVE ADVERSARIAL NETWORKS》 ICLR‘17
Databricks from open source to commercialization
cookie的介绍和使用