Display geometric shapes and output matrices

2 次查看(过去 30 天)
I want the following types of triangles to be displayed with the curvature of the edges and corners, and their matrix to be created as well.
I have no idea how to create them. I need both a matrix and a representation of it. I also want to be able to change the amount of curvature and the size of the sides(edges/curves).
The same goes for other shapes.
Please help to create these shapes with changable edges and their corresponding matrices.

回答(1 个)

Walter Roberson
Walter Roberson 2021-6-3
First row, first element:
  • take an equilateral triangle. Start from the bottom left point and draw an arc of a circle connecting the top centre point and the bottom right point. Start from the bottom right point and drawn an arc of a circle connecting the top centre point and the bottom left point. Now take an additional point that is as far below the base of the triangle as the center point is above the triangle, and use it as a center to draw an arc of a circle connecting the left and right points.
To phrase it another way, create an equilateral triangle that is pointed down, and subdivide each of each edges
A----1----B
\ / \ /
2 --- 3
\ /
C
and the first three shapes are based upon using different combinations of A/B/C or 1/2/3 as the center of circles joining 1/2/3
  4 个评论
HG
HG 2021-6-7
It's not a homework. It's a part of my project. if you can write the code, please help me.
Walter Roberson
Walter Roberson 2021-6-7
This is academic work that has been assigned to you, right? That is generally known as "homework".
If, hypothetically, this is a "project" for your employment, then
  1. you have strange (hypothetical) employment
  2. providing complete code for commercial use is the sort of task that my consulting arm gets paid for
You should be able to find the coordinates of the vertices of triangle ABC easily. You can write down two of the three through simple inspection:
A -> (0,0)
B -> (1,0)
C -> (1/2, something)
What is the value of something ? Well, you have a right triangle
1/2
A----1
\ |
\ | something
\ |
C
and the length of AC is 1. So by the pythagorean theorem, 1/2^2 + something^2 = 1^2 ?
You now have everything you need to know the positions A, B, C and 1, and you should be able to easily calculate the positions of 2 and 3 by bisecting the respective edges.
So... coordinates of the six locations can be calculated without difficulty.
And after that, start drawing circles of radius 1/2.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Elementary Polygons 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by