Time Nick Message 06:40 MTDiscord kilbith: Disagreed 06:40 MTDiscord while I like degrees, there are good reasons for radians 06:41 MTDiscord such as the Lua builtin math funcs all expecting radians 06:42 MTDiscord radians my precious 08:47 kilbith that's not enough to offset the intuitiveness of degrees 08:48 kilbith radians are to foot what degrees are to meter 08:49 MTDiscord No. 08:50 MTDiscord the only point degrees have going for them is that they can represent common angles using integers rather than multiples of pi 08:51 MTDiscord you can also straight up multiply radians with the radius to get the circumference :) 08:51 kilbith what happens in the real world is that a modder will instinctively feed a degree when they face a rotation function, 99% of the time 08:52 MTDiscord I'm all for consistency, but I would prefer going with radians 08:52 MTDiscord also kilbith: how would you back that claim up? 08:53 kilbith aside intuitiveness, degrees are also more consistent (irrlicht uses them) 08:53 MTDiscord granted, radians are introduced after degrees at school (primarily because pi is introduced late due to being irrational) 08:53 kilbith degrees are introduced earlier in school yes 08:53 MTDiscord irrlicht also uses both degrees & radians 08:53 MTDiscord it suffers from the same mess as Minetest 08:53 kilbith but to the general public, degrees are much more common also 08:53 MTDiscord some functions only take degrees, some only radians 08:54 MTDiscord but we're not targeting the general public, we're targeting the Minetest-modding public 08:54 kilbith Irrlicht's set_rotation functions take degrees 08:54 kilbith Minetest-modding public -> which is the general public 08:54 kilbith most of them are not mathematicians 08:54 MTDiscord irrlicht uses degrees? let's change that in irrlichtmt then 08:55 MTDiscord I support that 08:55 MTDiscord get rid of degrees 08:55 kilbith you see that's your problem, you can't make a software intuitive enough 08:55 MTDiscord degrees should only be for player-accessible settings like FOV 08:56 MTDiscord kilbith: as to your meter-foot analogy, I just found an interesting quote: "The number 360 can be broken in to many factors, 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 45, 60, 90, 120, 180, 360. This makes it easy to divide a circle into equal parts. (This is similar to the reason why we divide a foot into 12 inches.)" 08:56 rubenwardy The API should have used degrees, and there should be methods like `set_rotation_rad` for radians. This would have resulted in the most consistency 08:56 nrz as no one is happy with radians or degrees, i propose to use watch clock hours instead, at least we won't use math conventions ? 08:57 kilbith what rubenwardy says 08:57 nrz set_rotation('2h') 08:57 MTDiscord I propose we solve this the Java way 08:57 MTDiscord Our rotation functions should only accept objects of an Angle class 08:57 nrz generally in API radians have specific undernstandable radian calls an degrees are by default 08:57 rubenwardy but whatever. I was outvoted in 2017, and now the damage is done. Increasing inconsistency, the Minetest way 08:57 MTDiscord Radians and Degrees are subclasses of Angle 08:58 MTDiscord rubenwardy: I like the suffix solution. I think it should go both ways. func should keep using rads/degs for backwards compat. func_deg takes degs. func_rad takes rads. 08:58 MTDiscord that way there will be no surprises 08:59 kilbith no there would be only func() for degrees, radians takes an additional substring 08:59 kilbith -s 08:59 MTDiscord No. 09:00 kilbith man you're so stubborn 09:00 MTDiscord so are you 09:00 rubenwardy also, whilst radians may be better than degrees when calculating - they're both much worse than using transformation matrices. There's the gimble lock problem 09:00 MTDiscord gimbal* 09:00 MTDiscord we need quaternions, not transformation matrices 09:01 rubenwardy https://docs.godotengine.org/en/stable/tutorials/3d/using_transforms.html 09:01 MTDiscord we have scale, translation & rotation; switch rotation to quaternions and we'll be fine 09:01 rubenwardy transforms are a bit easier to deal with than quaternions, and also deal with position and scale 09:02 rubenwardy well maybe not, they're both equal levels of dark magic 09:05 rubenwardy although, you still invoke radians vs degrees in util functions object.transform.basis = object.transform.basis.rotated(axis, rotation_amount) 10:32 MTDiscord Could have rad2deg and deg2rad 10:32 MTDiscord As helper funcs 10:33 MTDiscord I agree degrees are easier to get so I understand why they were chosen for intuitiveness 10:33 MTDiscord But I also like having options 10:33 MTDiscord I also suck at math very bad and had to learn how radians work the hard way LOL 10:59 MTDiscord Lua has these already 10:59 MTDiscord math.rad and math.deg 11:00 MTDiscord lua > math.rad(180) 3.1415926535898 > math.deg(math.pi) 180.0 11:00 MTDiscord they were not chosen in the first place 11:01 MTDiscord they were chose in some places; degrees were chosen in other places 11:02 MTDiscord there's not much math involved here: just remember that 180° = pi in radians, or 360° = 2pi, or even that circumference = full circle in radians * radius = 2pi * radius 11:02 rubenwardy oh, handle 11:02 rubenwardy *handy 11:03 rubenwardy Lua doesn't have round but does have simple coverter 11:03 MTDiscord Ye 11:04 MTDiscord I suppose the good reason against round is that it is mostly redundant with math.floor(x + 0.5) or math.ceil(x + 0.5), but you have to spell out whether you want 0.5 to be rounded down or up (the entire rounding mode ties to something thing is a mess). 11:05 MTDiscord can't be doing it wrong if you're not doing it at all, that's the Lua philosophy 12:23 rubenwardy rad/deg is mostly redundant with * and / 12:28 MTDiscord hehe true 12:29 MTDiscord constants might indeed have been cleaner than func calls 22:38 rubenwardy merging #12732 in 10 22:38 ShadowBot https://github.com/minetest/minetest/issues/12732 -- fix not perfectly placed label in tab_online by Niklp09 23:17 Desour just to be part of today's bikesheddery: we could also use multiples of full circles, i.e. 2pi -> 1.0, 90° -> 0.25 => right angles (which is what we use most often in minetest) are still exact (though not integral) + there's no magic constant + you can get the same angle by taking the fractional part only + (most importantly) nobody uses it, so you are all equally unsatisfied 23:20 Desour (btw. ruben's suggestion of using transformation matrices works well with 90° rotations: )