Let's solve this geometry problem step by step.
1. Understanding the Problem:
We have a right triangle $$\triangle MNK$$ with right angle at $$N$$. $$E$$ is a point on the hypotenuse $$KM$$, and $$EF$$ is perpendicular to $$NM$$. Also, we know $$KE = 40$$ and $$EM = 30$$, and $$NF=FM$$. We need to find the perimeter of $$\triangle MNK$$.
2. Finding KM:
Since $$KE = 40$$ and $$EM = 30$$, the length of $$KM$$ is:
$$KM = KE + EM = 40 + 30 = 70$$
3. Using Similar Triangles:
Since $$EF$$ is perpendicular to $$NM$$, $$\triangle KEF \sim \triangle KMN$$ (similar triangles) and $$\triangle MEF \sim \triangle MNK$$. This is due to the fact that they share angles, and they have right angles.
4. Finding NF and FM
Since $$NF=FM$$, let $$NF=FM=y$$. Hence $$NM=2y$$. Also, $$\triangle KNF \sim \triangle KMN$$. Because $$\triangle KEF \sim \triangle KMN$$, we know that $$\frac{KE}{KM}=\frac{KF}{KN}=\frac{EF}{MN}$$.
5. Using Pythagorean Theorem
In $$\triangle KMN$$, we have
$$KN^2+NM^2=KM^2$$
$$KN^2+(2y)^2=70^2$$
$$KN^2+4y^2=4900$$
6. Using the fact that EF is the altitude
Because $$\triangle KMN$$ is a right triangle, we can see that the altitude $$EN$$ cuts the line $$KM$$ such that
$$EF^2 = KE \cdot EM$$
$$EF^2 = 40 \cdot 30 = 1200$$
$$EF = \sqrt{1200} = 20\sqrt{3}$$
7. Find the length of NM
Because $$EF$$ is perpendicular to $$NM$$, and $$NF=FM$$, we can see that $$\triangle NEF$$ and $$\triangle MEF$$ are congruent. Then $$NE = EM = 30$$.
Since $$NM = NF + FM$$ and $$NF=FM$$, then $$NM = 2NF$$.
Let $$NF = x$$, so $$NM = 2x$$
8. Using similarity of Triangles
Since $$\triangle KMN \sim \triangle EMF$$, we have
$$\frac{KM}{EM} = \frac{MN}{EF}$$
$$\frac{70}{30} = \frac{NM}{20\sqrt{3}}$$
$$NM = \frac{70 \cdot 20 \sqrt{3}}{30} = \frac{140 \sqrt{3}}{3}$$
9. Find the length of KN
Using Pythagorean theorem in $$\triangle KMN$$:
$$KN^2 + NM^2 = KM^2$$
$$KN^2 + (\frac{140 \sqrt{3}}{3})^2 = 70^2$$
$$KN^2 + \frac{19600 \cdot 3}{9} = 4900$$
$$KN^2 + \frac{19600}{3} = 4900$$
$$KN^2 = 4900 - \frac{19600}{3} = \frac{14700 - 19600}{3} = \frac{-4900}{3}$$
Something is wrong with my reasoning since $$KN^2$$ can not be negative.
Alternate Solution
In $$\triangle KMN$$, $$\angle KNM=90^{\circ}$$. Since $$EF \perp NM$$ and $$NF=FM$$, then $$EN=EM=30$$.
In $$\triangle KEN$$, $$KE=40$$, $$EN=30$$. Using Pythagorean theorem
$$KN^2=KE^2+EN^2$$
$$KN^2 = 40^2+30^2 = 1600+900 = 2500$$
$$KN = \sqrt{2500} = 50$$
In $$\triangle KNM$$, $$KM=70$$, $$KN=50$$. Using Pythagorean theorem
$$NM^2 = KM^2-KN^2$$
$$NM^2 = 70^2-50^2 = 4900-2500 = 2400$$
$$NM = \sqrt{2400} = 20\sqrt{6}$$
Perimeter of $$\triangle KMN = KN+NM+KM = 50+20\sqrt{6}+70 = 120+20\sqrt{6} \approx 168.99$$
Final Answer: The final answer is $$\boxed{120+20\sqrt{6}}$$