геометрия

How do I rotate a triangle?

I draw an isosceles triangle in the middle of the screen on Canvas. I draw from the center of the triangle (the intersection ... he rotation are calculated incorrect. What am I doing wrong? How do I calculate the new coordinates after turning a triangle?

Drawing an image rotated in the direction of movement | Graphics | Graphics2D

It is necessary to draw the image rotated in the direction of movement (the rotation should be relative to the center of the ... e to the center and the rotation is incorrect Details: I draw on JPanel in the method paint(Graphics gr) Using Graphics2D

how to calculate the distance between points on a 2D map if the world is looped (as in civilization)?

Just calculating the distance is not a problem. In my implementation, this is: let distance = Math.sqrt((players[socketId].x ... see each other. How can I make a formula so that they remain visible, taking into account such an organization of the world?

The rotation matrix, why doesn't it work as expected?

There is a rotation matrix In my program it works correctly, rotate the point at a specified angle, but I can't understand w ... riment programmatically, I got the same result: rotation in the opposite direction. Maybe someone knows something about this?

How to determine for a maximum of two comparisons whether there is a triangle with sides of length a, b and c?

Given three numbers: a, b, c. How to determine for a maximum of two comparisons whether there is a triangle with sides of ... everything is clear, but how to do it for 2 comparisons? Ps the question is not educational, met in preparation for sobes :)

How to calculate the lengths of the basis vectors?

Hello everyone How to find the length of the basis vectors in the affine coordinate system? It is known that there are point ... the vertex C and has the legs |CA|=2, |CB|=3. Determine the lengths of the basis vectors {e1,e2} and the angles between them.

How to calculate the perpendicular to a straight line?

Two points of a straight line are known, for example, {100, 100} and {200, 200}, and there is a point that does not lie on th ... point relative to the straight line will be perpendicular, if you draw a line? The response in the Java code is desirable.

Find the perimeter of the polygon

The task looks like this: But maybe I'm doing something wrong, can you tell me? from math import * a = [] while True: ... = 0 n = len(a) / 2 print(n) for i in range(1, n): sum = (a[i] - a[i - 1]) ** 2 len += sum i += 1 print(sqrt(l))

How to build a smoothly increasing graph?

I want to generate data for plotting a graph of the following type: I can easily build area 1 and 3, but I can't build area ... point where the curve should end the value of the derivative of the curve at the point x2 Plot a smoothly increasing curve?

Rotate a vector around another one

I'm writing a simple game with graphics(the ball bounces off the window borders and lines, which the user builds himself). I ... rly). I would be glad if someone could help me find the answer to this question. I have been suffering for more than a week(

Finding a value at a certain point (inside) a triangle

For example I have a triangle with vertices A B C. Each of these vertices is associated with a certain value (we abstract fro ... he triangle or on one side of the triangle. How can I find the value at the point D as easily as possible (in fewer actions)?

Determine if 3 points lie on the same straight line on C#

It is necessary to determine whether any 3 points from the set lie on 1 straight line. The problem is that the coordinates of ... ] - y[i])) - ((x[j] - x[i]) * (y[k] - y[i]))==0) { The coordinates are written in two lists.

How to find a point relative to from an endpoint with a certain length

I have a problem finding a point in the OXY space. I have a straight line with two points A and B, I need to add a small segm ... point.X = ((point.Y - point0.Y) / vector3.Y + point0.X / vector3.X) * vector3.X; return point; }

Find the length of a segment that is part of another segment

2 segments are given. You need to determine whether the points of one segment belong to another. And what is the length of th ... 2_line1_start * seg2_line1_end == 0){ return true; } } How to determine the length?

search for a point on the map by two coordinates and distances to it

I figured out how to find the distance between two points on the map, but I can't figure out how to solve the inverse problem ... d what angle this cosine corresponds to, and how can I get bearing to calculate the coordinates? or did I do something wrong?

How do I draw such an arch through a chord point or corners?

The following task is worth it. Required using the library Maker.js draw an arch like this: Drawing an arch starts from t ... e calculation of points or angles must work correctly for a large radius (for example: 1000) and for equal H and H1 (H===H1).

Find the length of the rectangle when changing the inner side

I have such a problem and I would not refuse help or at least hints in which direction to think in order to solve it. The ess ... nt A1C1 (we also don't know these positions). We need to find the position of the point With and the length of the segment AC

For a point specified by the x and y coordinates check whether it belongs to the shaded area in the javascript drawing

Can't solve with circle Triangle: x=parseFloat(prompt('x')) y=parseFloat(prompt('y')) if(x>=0 && x<=6 && y<=0 && y>=-6) document.write('true') else document.write('false')

Do I need higher mathematics in web programming? [closed]

Closed. This question is off-topic. Answers to it are not accepted at the moment. ... on mathematics in Russian (except for children's books) - I found some good books in English, so I'm sitting here studying.

Intersection of a sphere and a triangle

I am currently engaged in moving a sphere in space with collisions with other objects. There were problems with solving the p ... C (x3, y3, z3). It is necessary to answer the question: does the triangle have at least one point in common with the sphere?