Cannot cast type

netbee

New Member
Compiling code. Error
Error compiling program.
Error description: Cannot cast type: {Type=Double,Rank=0} to: {Type=Double,Rank=1}
Occurred on line: 47
Pt1(0)=Pt0(0)+Dist*CosD(angDrs)

===============================
Has been resolved
Separator
B4X:
Ptx(0)=px,Ptx(1)=py 'It should be ':' he was entered as ','

dist=Fun.distance(Pt0,Ptx)*1.5

Pt1=Fun.polar(Pt0,ang0,dist)
Thank you very much answer
 
Last edited:

netbee

New Member
B4X:
Sub polar(Pt0()As Double ,angDrs As Double   ,Dist As Double )As Double()
Dim Pt1(2)As Double 
Pt1(0)=Pt0(0)+Dist*CosD(angDrs)
Pt1(1)=Pt0(1)+Dist*SinD(angDrs) 
Return Pt1
End Sub
 
Top