# Trigonometry help

**URL:** https://forum.kirupa.com/t/trigonometry-help/163969
**Category:** Uncategorized
**Created:** [September 27, 2005, 6:39pm UTC](https://forum.kirupa.com/t/trigonometry-help/163969 "2005-09-27T18:39:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ditti](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@ditti](https://forum.kirupa.com/u/ditti)
#### Post date: [September 27, 2005, 6:39pm UTC](https://forum.kirupa.com/t/trigonometry-help/163969/1 "2005-09-27T18:39:51Z")

</div>

Hello !  
Is there someone who is good at trigonometry?  
I have two points punkt1 and punkt2 and a line that is drawn between them. Both points is dragable. I want the line to continue after the points in both directions and with the same steep. I have counted the steep between point1 and point2 and tried to continue to drag to a point with the same steep, but it doesn´t succed.

```auto
 
onLoad = function(){
_root.punkt2._x=100;
_root.punkt2._y=100; 
_root.punkt1._x=200;
_root.punkt1._y=200;
}
//-----------------------onEnterFrame------------------------ 
 
onEnterFrame = function() {
 
function doDrag() {
  this.startDrag();
 } 
 
 function noDrag() {
   stopDrag();
   
 }
 
 _root.punkt2.onPress = doDrag;
 
 _root.punkt2.onRelease = noDrag; 
 
 _root.punkt1.onPress = doDrag;
 
 _root.punkt1.onRelease = noDrag; 
 
 
a1=punkt2._y-punkt1._y
a2=punkt2._x-punkt1._x
k=a1/a2
p3x=punkt2._x/k+punkt2._x
p3y=punkt2._y/k-100
createEmptyMovieClip('hold', 10);
  with (hold) {
  clear();
  lineStyle(2);
  moveTo(punkt1._x, punkt1._y);
  lineTo(punkt2._x, punkt2._y);
  lineTo(p3x, p3y);
  
  }
}

```
