View Issue Details

IDProjectCategoryView StatusLast Update
0000960FreeCADBugpublic2013-01-16 12:43
Reporternicolasriglet Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionno change required 
Product Version0.12 
Fixed in Version0.13 
Summary0000960: Distance error after rotation
DescriptionIt seems to have inversion between sin and cos to compute distance after rotating a block.

I create two blocks with height of 3855mm. I rotate them of 40° to make something like a roof. Normally, the distance beetween these two blocks should be equal to :
cos(40°)*3855 * 2 = 5906mm but it is equal to 4956mm.

It is very strange because 4956 equal to sin(40°)*3855*2 which is the height multiple by 2 and not the total width.

I hope I have been clairly...

See the attachment file.
TagsNo tags attached.
FreeCAD Information

Activities

2013-01-16 08:16

 

error_distance_after_rotation.PNG (Attachment missing)

wmayer

2013-01-16 10:49

administrator   ~0002852

Some comments:
when computing the distance between two points P1=(x1,y1,z1) and P2=(x2,y2,z2) we neither need sin nor cos. The distance is just:
d=sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) + (z1-z2)*(z1-z2))

The angle shown on the image is clearly >>40 deg, maybe 80 deg. Let's say A,B,C are the angles in the triangle and a,b,c the lengths of the opposing sides. Then we know from math that:
(sin A)/a = (sin B)/b = (sin C)/c

So, in this case A=80 deg and thus B=C=50 deg (due to symmetry) and b=c=3855
We want the value of a which is a=b*(sin A)/(sin B)
=> a = 3855*(sin 80 deg)/(sin 50 deg) = 4955.89 ~ 4956

So, everything makes pretty much sense and I don't see any bugs.

wmayer

2013-01-16 11:07

administrator   ~0002853

Btw, you can also get the distance with 2*B*(sin 40 deg) as you wrote above. It is sin, not cos.

nicolasriglet

2013-01-16 12:00

reporter   ~0002854

Last edited: 2013-01-16 12:37

Ok.

I am really sorry. I understand my mistake.

Finally by rotating my blocks to 40° degree, I create a angle of 50° and not 40°. So, there is not error, that give the good result cos(50°)*3855 * 2 = 4956mm

Thank you wmayer, you was true. The angle was bigger than 40°.

YOU COULD CLOSE THE ISSUE....

Issue History

Date Modified Username Field Change
2013-01-16 08:16 nicolasriglet New Issue
2013-01-16 08:16 nicolasriglet File Added: error_distance_after_rotation.PNG
2013-01-16 10:49 wmayer Note Added: 0002852
2013-01-16 11:07 wmayer Note Added: 0002853
2013-01-16 12:00 nicolasriglet Note Added: 0002854
2013-01-16 12:37 nicolasriglet Note Edited: 0002854
2013-01-16 12:43 wmayer Status new => closed
2013-01-16 12:43 wmayer Resolution open => no change required
2013-01-16 12:43 wmayer Fixed in Version => 0.13