#Distances in analytical geometry

1 messages · Page 1 of 1 (latest)

silent gyro
#

As we already know, there exists a formula to find the distance of a point of a line, namely $\frac{|Ax_1 + By_1 + C|}{\sqrt{A^2+B^2}}$. Is it possible to find a formula for the distance of a point from a polynomial function, or even better, the distance of a point from any given f(x) where f(x) can be polynomial, exponential, trigonometrical, piecewise etc.? The formula doesn't have to be generalized for all f(x), there can be different formulas for sinusoidal and polynomial f(x) here. I've been stuck on this for a month now...
Also, this is just a personal doubt, not something I was asked in school or anything.

plush cobaltBOT
#

No Lifer?

viral agate
#

This is crazy hard problem to solve in general

silent gyro
#

well

viral agate
#

But one can approach it by considering it as an optimization problem.

silent gyro
#

I was stuck at it for a month

silent gyro
#

I have a vague idea for quadratics, but that's basically it

silent gyro
viral agate
#

You know distance function to certain point right

#

This is basically about mininization problem of that.

silent gyro
#

like, distance between 2 points right?

#

I know that

#

and i know the line thing

viral agate
#

Line thing?

silent gyro
#

distance from point to line

#

I posted the formula above

viral agate
#

That is not so useful

silent gyro
#

It's just there

viral agate
#

Yea

silent gyro
#

it helps in creating parabolas, that's all

viral agate
#

So basically, parametrize the curve

final sky
#

This reminds me of like certain metrics in probability like the mahalobonis distance but WAYY more general

viral agate
#

And formulate distance to it as a function

#

Boom, Minimization

silent gyro
#

hmmm

#

there has to be an exact func though

#

sinusoidal seems the easiest

#

let's try that one first

final sky
#

Is this not involving alg geo??

viral agate
#

Thankfully I think algebraic geometry is not needed here

silent gyro
#

but seriously, if rizzly somehow solves this and convinces the riddle team to post this as a riddle

#

nah

viral agate
#

This is too computation-heavy to become a riddle, sadly

#

@static sonnet Can you solve this

silent gyro
#

hmmm

#

I have an idea for sinusoidal wave

#

we need an f(x) that locates a certain point

#

draw line

#

do intersection

#

more nonsense

#

tada

#

the period is key

#

alr

#

I'll focus on my half-yearly exams

#

then this

final sky
#

It seems super complication most likely unsolvable unless you have some constraints on the type of surfaces ig

silent gyro
#

oof

static sonnet
#

for sin in general i believe this produces a transcendental equation

silent gyro
#

transcendental?

iron kelp
#

I think you can do it, but using infinite polynomials

final sky
# silent gyro transcendental?

Transcedental equation are equations that are insanely insanely hard to solve in the best case scenario. I heard that they are usually impossible to solve with algebra and approximations using computers are the only way

#

Like for example: x*e^x = 1

#

Or sin(x+ sin(x)) = 0.3333

#

Or something crazy like that

#

Don't take what I say as factual, this is what I think it is. The first and only time I heard about these things was in a Numberphile video about the Goat problem or somrething like that

#

@silent gyro These kinds of very general questions are hard. I also thought of a similar question: Given any 2 2D shapes(convex or concave) with their respective areas given, how can you calculate the sum of their areas? (There are cases that they might overlap and how they overlqp change the area sum and it also depends on the exact shapes)

#

I think general problems like ours are just so general that only special cases are solvable in a humane sense

#

Just how @final sky said above

final sky
static sonnet
final sky
#

Well yeah but what about general shapes

#

Like if you were given an iregular pentagon intersecting at a weird angle with just a part of an ellipse

static sonnet
static sonnet
#

that is not a pentagon

final sky
#

Well the problem is about general shapes

static sonnet
#

and yeah my method will solve that it's just difficult

#

as opposed to something like sin(x)cos(2x) + cos(3x-sin(4x)) = 1.1 which probably has no way to solve

final sky
#

Actually, about this topic, how do we know that these kinds of equations are not solvable?

#

Like are there actual proofs showing that they are impossible?

static sonnet
#

i think so, yes

viral agate
# final sky

Approximate the ellipse with a 100-gon, then you are golden ye

static sonnet
viral agate
#

Wdym "if you want the perimeter of the shape"? @static sonnet

static sonnet
#

no approximation needed for area i mean

viral agate
#

Oh you can compute that area directly?

#

Thinking about it, I guess it is just some integration

viral agate
#

Woah

silent gyro
#

wow

#

transcendental

#

yeah um

#

i give up

iron kelp
# final sky

It can always be solved, but the calculation varies depending on the shape and the measurements must be given.

final sky
#

I see

final sky
#

Guess that only works when the vertices of points lie only on integer coordonates points

static sonnet
#

that's polygons

#

so yeah not really working here

proven halo
#

me and @final sky will help

final sky
#

Well

silent gyro
#

hmmm

final sky
#

I say create parametric form of the function

#

And then optimize the distance using distance formula

silent gyro
#

I don't have any idea where to start with this though

#

I think derivatives will be required though

final sky
#

What i am saying is a rathwr generalized technique

final sky
silent gyro
final sky
#

That would be our last resort if inequalities dont work

silent gyro
#

I think a sinusoidal wave would be easier to start with

silent gyro
#

inequalities?

#

how would those help here?

final sky
#

am-gm

silent gyro
#

oh

final sky
#

Cauchy

silent gyro
#

the typical inequality

final sky
#

Help us to predict range directly

silent gyro
#

ah

final sky
#

Without having us to calculate at what point its minimum

#

Basically

#
  1. paramatrize the function
  2. write generalized distance formula
  3. optimize it using derivatives/inequalities
#

Thats what you need to go

silent gyro
#

parametrize the function

#

how would we go ahead with that though...

#

sorry if I'm acting stupid here

final sky
#

Well even i dont really on that part to be honest

#

Parametric equations get you the locus of a point on the curve using a single variable

#

Thus they are very helpful here

silent gyro
#

hmmm

static sonnet
#

what are you guys talking about

final sky
#

But you would need to learn how to actually paramatrize equations

silent gyro
#

oof

silent gyro
#

Or

#

Shortest distance from a point to any f(x)

final sky
silent gyro
#

any f(x), but sure

final sky
#

Any fx

#

This would always work

#

Unless @static sonnet can tell something

silent gyro
#

sinusoidal wouldn't count as a curve right?

#

It could be called an infinite polynomial

#

but

#

idk

static sonnet
#

lets try finding the distance from (1,1) to cos(x)
we would like the line through 1,1 that hits cos(x) perpendicular to it
so a(x-1) + 1 = cos(x) where -sin(x) = -1/a
x = arccsc(a)
we want a(arccsc(a)-1) + 1 = cos(arccsc(a))
and now there is an issue
maybe we can replace cos(arccsc(a)) with sqrt(a^2-1)/a but still going to have a problem

silent gyro
#

derivatives

#

hmmm

#

-sin(x) at x should be perpendicular to the line with points cos(x) and 1,1

#

wow

final sky
static sonnet
#

cos(x) has a very cool set of normal lines iirc

silent gyro
#

$\frac{1}{\sin{x}} = \frac{|1-\cos{x}|}{|1-x|}$

plush cobaltBOT
#

Martian Attack Helicopter

silent gyro
#

uh

#

that looks wrong

final sky
#

Fuck all that logic and stuff

#

((1 - cos(x))^2 + (1-x)^2)^(1/2)

#

Minimize the abivw

#

And its done

#

Prolly

silent gyro
#

$|1-x| = \sin{x}|1-\cos{x}|$

plush cobaltBOT
#

Martian Attack Helicopter

final sky
#

@static sonnet am i right ?

silent gyro
#

$((1 - cos(x))^2 + (1-x)^2)^{1/2}$

plush cobaltBOT
#

Martian Attack Helicopter

static sonnet
#

here they are

silent gyro
#

damn

#

that looks insane

final sky
#

,w minimize ((1 - cos(x))^2 + (1-x)^2)^(1/2)

#

@silent gyro done

static sonnet
#

no

silent gyro
#

hmmm

static sonnet
#

it didn't find an exact solution which is my point

final sky
#

why not

final sky
static sonnet
#

you have x approximately

silent gyro
plush cobaltBOT
#

Martian Attack Helicopter

final sky
#

@static sonnet minimise it by hand then

#

Numbers wont be good

silent gyro
#

,w minimize 1+x^2-2x=sin^2(x)*(1+cos^2(x)-2cos(x))

final sky
#

I assure you that

plush cobaltBOT
silent gyro
#

wow

final sky
#

,w calculate (0.789781,cos(0.789781)

static sonnet
#

eyy look at that it can get exact forms oh wait no

silent gyro
#

wow

#

what did i create

static sonnet
#

what do you mean

silent gyro
#

what have I done

#

but

#

The perpendicular thing

#

I never thought about that

#

wait

#

the differential of an f(x) returns a func that returns the gradient of the original func at a certain point

static sonnet
#

the derivative, yes

silent gyro
#

yep

#

and we want this function to return someth perpendicular

#

ok

#

if a line has slope m

#

a line perpendicular to it has slope -1/m

#

for let's say, cos(x)

#

and point, 1,1

final sky
silent gyro
final sky
#

You need to select shortest one now

#

Perpendicular isnt the only condition

static sonnet
#

the shortest one will always be a perpendicular one if f(x) satisfies some sort of smoothness condition, though

silent gyro
#

hmmm

#

yeah what rizzly said

#

I'm operating on that

static sonnet
#

(also, krypton, there is a unique one that goes through (1,1))

final sky
silent gyro
#

If there's multiple roots

#

I'll take the one closest to 1,1

static sonnet
final sky
static sonnet
#

look here's 1,1

#

only 1 line going through it

static sonnet
#

yeah that probably has multiple

#

i don't remember if i was successful in determining the exact area in which there is only 1 solution

final sky
#

does every point have atleast 1 line

final sky
#

Or we can try it

#

And verify later between us

#

@static sonnet deal ?

static sonnet
#

visually

#

it looks like they do

final sky
static sonnet
#

well of course

#

every point has a closest one

final sky
#

I was trying to think of edge cases

#

Point on the curve ones

#

Would they have a normal to its own curve except their own ?

#

@static sonnet wanna fully calculate this ?

#

Not rn

#

But like whenever each of us have time

static sonnet
#

if you draw the normals as x moves from π to 3π/2 you get one segment of the hyperbola-looking curves

#

then minimizing the y value it becomes transcendental so probably no

#

might be a parametric but i don't think even that can happen

final sky
#

Let you know if i get anything

#

Anywats

#

Good night @static sonnet

final sky
#

Hmm

#

This reminds of Voronoi diagrams